Olli Wang wrote:
> thanks. does it can set default value like that? i want use the same
> form to deal with "add new" and "edit post" like wiki20 tutorial. i
> have no idea how to use it.
You can set the default value only at instantation time.
But you can pass the value to be displayed on the first form display by
using the same method as for options, for example if you have a form
like this:
class PageFormFields(WidgetsDeclaration):
page = TextField()
languages = MultipleSelectField(options=[(1, "Python"), (2,
"C"), (3, "Java")])
form = TableForm(fields=PageFormFields())
you should use:
form_values = dict(page="pagename", languages=[1,2])
The you display your for form in this way:
form(value=form_values, options=...)
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
-~----------~----~----~----~------~----~------~--~---