Gregor Horvath wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > hi Michele, > > Michele Cella schrieb: > > > > > The attribute is setted the first time a widget tries to append itself > > to the path: > > > > http://trac.turbogears.org/turbogears/browser/trunk/turbogears/widgets/forms.py#L60 > > Thanks for your help, but actually this setting is always to []. > Look at the function, line 61 could also be written as: > > request.tg_widgets_path = [] > > path is at line 61 always []. > > > def append_to_path(widget, repetition): > 56 path = [] > 57 if request_available(): > 58 if hasattr(request, "tg_widgets_path"): > 59 path = request.tg_widgets_path > 60 else > 61 request.tg_widgets_path = path >
Yeah, that's just the initialization stuff to sync the path variable to what actually resides on tg_widgets_path, if tg_widgets_path it's not there it's initialized as an empty list, and just after that: 63 path.append(Bunch(widget=widget, 64 repetition=repetition)) the widgets (if not already there) it's appended to the path. I'm the one to blame for this code, I know it's not so nice as today I wouldn't rewrite it in this way probably, I 'm also not happy with tg_widgets_path but at that time it seemed like the only viable solution to avoid the need for widgets users to pass explicitly the path as an argument upon display. BTW I'm really looking forward to Alberto improvements. ;-) Ciao Michele --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

