I know how to get a widget to look stuff up itself by passing in a
reference to a function, allowing the widget template to call the
function. IE
class BlockHeader(widgets.Widget):
template = """
<div>Page title: ${dbf(page_id).title}</div>
"""
params = [ 'page_id', 'dbf' ]
and in the controller:
w_header = BlockHeader( page_id=1, dbf=databaseFunction )
My question is whether I could instead add a custom helper function to
the widget class definition and somehow have the template be able to
call this function. At the moment it uses eval to conduct some jiggery
pokery around the name ...
If I add a method to the widget the template does not have access to it.
Should I try to add a property to the widgets template object? Is there
someway to access the widgets methods from within the template object?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---