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() ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.