On Thursday 13 September 2007 10:54:34 Straphka wrote:
> Ok, here is the problem.
> I have found some similar problems on this group, but couldn't quite
> apply the solutions given there to my (probably very basic) problem.
>
> I have a list of widgets:
> LinkForm = widgets.TableForm(
> fields = [
> widgets.HiddenField('linkid'),
> widgets.TextField('title_en', label='English title'),
> widgets.TextField('title_nl', label='Dutch title'),
> widgets.SingleSelectField('catid', label='Catagory',
> options=[('','')]),
> ],
> validator=LinkSchema(),
> )
>
> ok, cool, I can use that.
> Now I want to pass data to it before display:
> data = dict(
> linkid = link.id,
> title_en = link.title_en,
> title_nl = link.title_nl,
> catid={'options': [(1,1)]},
> )
>
> And I render it (using genshi) with:
${ET(form.display(data, action='/action', options={'catid' : catid})}
should do the trick. If not, search this group - that has been discussed
extensively, including other approaches.
Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---