Eoghan schrieb: > I know this has been touched on before; > http://groups.google.com/group/turbogears/browse_thread/thread/69d79f7fd7be79f0/bf395a5c6721da91 > > I'm looking for a way to edit the label text in a widget from a > controller, e.g. something like the following pseudo code: > > @expose() > def myform(self, **kwargs): > if some_condition: > my_list_form.myfield.label += " Some extra text" > return dict(my_list_form=my_list_form) > > I've tried something like this and have gotten ValueError: It is not > threadsafe to modify widgets in a request > > At the moment it's looking a lot easier to skip the widgets and put > the html for the form directly in my template in conjunction with a > FormEncode validator..
How about subclassing the form and adding a labels-parameter that contains a dict mapping fields to labels. Then either use that label, or do the default, aka display the label the widget defines. Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

