Alberto Valverde <[EMAIL PROTECTED]> writes: > The update_data method *IS* needed. Without it we wouldn't be able to > override widget attributes at display time (which I think is essential) or to > pass new variables to the template for each render (like passing a new css > class for changing a textfield's background color, etc). > > It's what makes the new widgets thread-safer too: a new dictionary is built > at each render for the values needed for EACH request. And gives more control > of what actually is being sent to the template (think of it as a > "mini-controller" for a "mini-template" :)
This is exactly what I needed to know ;-) Thanks for your explanation. > I still think something must be done to reduce the boiler-plate code though, Reduce: yes! But please make it simple and legible as well. I'd rather have 10 lines of code that are easy to maintain than having to decypher 3 or 4 lines. It will also make it clear for newcomers. > What I'm positive about is that the widget instance should NOT be passed to > the template, just to emphasize that the template variables are updated at > every render (plus all the, now diminished, thread- safety issues). Now that I understand it, this sounds like it is the better, indeed. And would also avoid having people - like me ;-) - hurting themselves. :-) -- Jorge Godoy <[EMAIL PROTECTED]>

