I have this form:
class MyFields(widgets.WidgetsList):
messagetext = widgets.TextArea(name="messagetext",
validator=validators.NotEmpty())
categories = widgets.CheckBoxList(name="categories",
validator=validators.NotEmpty())
I want to set the options attribute for the categories checkboxlist in
my template, but I can't figure out how to do it.
Here is the relevant controller:
def x(self, z):
cats = _get_categories(z)
return dict(f=widgets.ListForm(fields=MyFields()),
d=dict(messagetext="blah", categories=cats))
And here is the section from my kid template:
${f(value=d)}.
My textarea widget gets the value "blah" I pass in, but my
checkboxlist is empty.
If I can't pass in the values in the template, is it possible I pass
them in when I instantiate the MyFields class?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---