The annotated version:
I don't know how good/bad it is, but this is what I did:
In widgets/base.py I changed, in the Widget base class, the
update_params which is passed, to see if param['value'] is callable and
if so call it and assign its results to itself. This allows me to do
something like this:
def _get_blog_default(default):
def _default():
return ( the default we're looking for )
return _default
and assign a new widget:
categories = widgets.MultipleSelectField(label='Category',
default=_get_blog_default('categories'), options=_get_category_list,
validator=validators.NotEmpty)
_get_blog_default returns a function for which Widget calls to get a
default value for a given field. I haven't had anything break, yet, so
I think it was OK to do this. Could someone please essentially "audit"
my decision and see if I *shouldn't* have done it this way?
woohoo!
-Sam
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---