Hi Keith,
Setting an initial value on display should get you going:
class MyForm(TableForm):
fields = [
TextField("name")
FieldSet("sub", fields= [
TextField("age")
]
]
form = MyForm()
values = dict(name="aaaa", sub=dict(age=44))
form.display(values)
Hope it helps,
Alberto
On 04/03/2006, at 12:38, Keith R. Fieldhouse wrote:
>
> Up until now, all of my forms have started empty and are filled in by
> the user.
>
> Now, however, I want to pre-popluate it with some data from my
> database. I realize that I'm missing something obvious but I don't
> know
> what. How do I explicitly set the values that will appear in the form
> when it's displayed. I assume there's something I need return in the
> dictionary I return from my form displaying method. But what?
>
> In looking at the tests, it appears that it might have something to do
> with calling validate() on the form. Do I do that in the template? Or
> is there some other magical way to get that to happen.
>
> Best,
>
> Keith
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---