#2352: Provide widget instance to callable default value
-------------------------+--------------------------------------------------
Reporter: xaka | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: TurboGears | Version: 1.0.8
Severity: normal | Keywords:
-------------------------+--------------------------------------------------
Good fix was provided in #1715 but not enough. I think that you should
pass widget instance to callable object when calling. It makes possible
return values depend on some attributes of widget (name or one of params).
When you use callable object for default value it should be similar to
instance method with "self" first argument.
Simple example:
{{{
def value_from_db(field):
return get_value_from_db(field.name)
form = MyField(default=value_from_db)
}}}
Thanks.
--
Ticket URL: <http://trac.turbogears.org/ticket/2352>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---