O'Reilly logo

Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites by Gigi Sayfan, Kevin Dangoor, Mark Ramm

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8.3. WhatWhat Status Widgets

In the widgets directory, you’ll find widgets.py, which defines each of the widgets that WhatWhat Status uses in the Recent Changes page.

Each of these widgets inherits from the turbogears.widgets.widget base class, which provides methods such as the display method used to display each widget in the recent changes template:

from turbogears.widgets import Widget class NoteWidget(Widget): template = 'whatwhat.widgets.templates.note' template_vars = ['note', 'read_only'] read_only = False note_widget = NoteWidget() class NotesWidget(Widget): template = 'whatwhat.widgets.templates.notes' template_vars = ['notes', 'read_only', 'note_widget'] note_widget = note_widget read_only = False notes_widget = NotesWidget() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required