#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       |   Resolution:       
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by chrisz):

 TG 1.0 is actually in feature freeze since many months; such things should
 go into 1.1.

 But I'm not convinced that this feature should be included because it
 makes things more complicated. I'm all for keeping things simple and
 consistent - there are several other places (e.g. widget parameters) where
 we take callables, and they do not get parameters passed either. Neither
 does !ToscaWidgets with which I'd like to stay compatible where possible.

 Also, it's easy to achieve the same effect with a plain callable already.
 Here is an example where I pass the corresponding form widget instance
 (not the field instance which I think is less interesting):

 {{{
 class MyForm(widgets.TableForm):

     def mydefault(self):
         return "Bozo" # we could use self here

     fields = [widgets.TextField('name')]

 myform=MyForm()

 myform.fields[0].default = myform.mydefault
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2352#comment:1>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to