On Mon, 7 May 2007 at 21:20, AZMel wrote:
>        model_form.fields[1].default=reachID.id
>        return dict(modelname = self.modelname,
>                    record = record,
>                    form = model_form,
> tg_paginate_limit=tg_paginate_limit, tg_paginate_no=tg_paginate_no,
>                    rootDir=self.rootDir)
[...]
> Why am I allowed to set it the first time through by now again?  Is
> there a way around this?

I don't know why it is letting you define it the first time around, but
you certainly don't want to be doing that.  Like the error message
says, it isn't thread safe.  Pass the default at display time:

         return dict(  ....
             form = model_form,
             defaults = dict(<fieldname>=reachID.id),
                 ...

             )

and then in your template:

     ${form(record, default=defaults)}

--David

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