Michele Cella wrote: > Hi guys, > > I would like to hear your opinion on these things: > > 1) We have the nifty template_vars attribute that let's us pass values > at class, construction and display time without the need to implement a > single line of code. > > While writing some widgets I have noticed that I would like to use it > even for some parameters that I need but that at the end will not end > up to be used inside the template (an example is the disabled_fields > parameter for a form), in other case the name used in the template is > the same as the one in template_vars but the content of the variable is > not exactly the same. > > So I'm wondering should we rename template_vars to a more generic name? > parameters perhaps? the reason is that I avoid using template_vars if > the attribute used is not directly present inside the widget template > since the relation between template_vars and template is being lost in > this case.
+1 Perhaps tg_args (since Python uses the term argument)? > > Or should we introduce another type of "magic" attribute like this one > to manage those case? something like other_parameters (better name)? > this one will automatically remove things from the dict after > update_data has finished, but it's not my preferred one since we will > need to explain the difference between this, template_vars and also > member_widgets for compounds. -1 Sounds too complicated. > > 2) I would like to rename some of the generics methods we are using to > make it clear that you can use any type of object that provides those > methods, just like in python you can provide a custom iterable with a > proper __iter__ method, so that's what I'm proposing: > > retrieve_javascript -> __javascript__ > retrieve_css -> __css__ > validate -> __validate__ +1 We should gather all informal protocols and apply a consistent naming-scheme. Cheers, Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk -~----------~----~----~----~------~----~------~--~---
