Kevin Dangoor wrote: > > I'm not following this. Are you saying you include a tag for each > widget and it gets expanded out at render time? >
Yep, sorry I've written it too quickly. That's something I've tried 1/2 month ago as a proof of concept, the idea I had was to make it easy to provide attributes for widgets (like a TextField) from the template (not the controller, not the insert method) without the need to construct a big python dict, so I've made a custom tag like this: <attributes widget="form.age" size="10" class="..." /> the widget value is the path for the widget I want to apply the attributes, in this example the form variable has a textfield with name "age". At kid render time, this tag will be matched and using a python code block you can cycle between al values pair defined by the tag to prepare a dictionary, this dictionary will then be applied to the form.age instance: form.age.attrs = the_dict In this way when the age widget will be inserted it will use the attributes you provided. When I've tried there weren't forms declarative style, so now it should be easier to do. ATM I can't find the code I used but it's not difficult to do. Note, that this was just a test, the names I used are broken (<attributes> for example) and so on. One nice thing I noticed is that you could take advantage of Kid inheritance from this, for example by defining global attributes in your master.kid or even overriding them on another template. Yes, I know that's a crack idea. Ciao Michele PS I don't think I've been able to express this in a clear way. :-( I will try to prepare a small example when I can.

