Florent,

> In the template you cannot use the default argument. It is only used
> in the constructor... but you can use "value" like this:
>
> <span py:strip="True"
> py:content="reach.display(value=someid)">SingleSelectField</span>
>
I changed my controller to pass this:

        return dict(modelname = self.modelname,
                    record = record,
                    form = model_form, defaultID = reachID.id,
                    tg_paginate_limit=tg_paginate_limit,
tg_paginate_no=tg_paginate_no,rootDir=self.rootDir)

and I modified what you wrote to this:

<span py:strip="True"
py:content="form.fields[1].display(value=defaultID)">SingleSelectField</
span>

Now I get a select field showing on top of my existing form form with
the value I want to be defaulted to.  I can refresh, go back and
select a new record to edit without getting the threadsafe error. This
does get me a lot closer.

Would I have to build the form manually, by displaying all the fields
like I did with form.fields[1].display to get this to work, or is
there a way to change the form object being passed to the template
beforehand?

Thanks,

Mel


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to