Diez B. Roggisch wrote:
>
> There are two options:
>
> - pass a callable to options. It will be evaluated each time the form
> is rendered.
>
> - pass the options as parameter to the form when rendering it:
>
> ${form.display(value, options={'fieldname' : <optionlist/>})}
>
> See this:
>
> http://groups.google.co.kr/group/turbogears/browse_thread/thread/15f0585b4604405b
With a little more digging I had just got this one sorted. Thanks.
>> My other question that has just bitten me on this is the format
>> parameter for a DatePicker widget. At the moment I specify it in the
>> form which, as normal, gets constructed at load time. However, I need to
>> set the date format dynamically according to the language of the current
>> request.
>
> This is actually a lack in the DateTimeConverter.
>
> I personally have a patched version that allows format to be passed a
> callable to allow what you want.
>
> If I come to it, I'll send it to you tomorrow, as the code is at work.
>
> Diez
Sadly I need to change the format in the FormEncode schema that goes
with the form as well. I know that TG's own DateTimeConverter will
assume a validator of the same format as the widget, but on a couple of
forms I need to specify a DateTimeConverter validator in conjunction
with others on that field. I guess I will eventually work around that as
well.
I think the main problem is that there seems to be no easy and efficient
way to generate and use a form/widgetlist/validator modifiable
*instance* at runtime. The above two problems were just the first I've
come across with this static construction model for forms. I'm sure
there will be others.....
Most other frameworks I've used (Django, .NET, ...) construct a "form"
instance at runtime per request. You then fiddle with this as desired
for this specific request and get it displayed.
Thanks again,
Gary.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---