On 2/17/07, paulh <[EMAIL PROTECTED]> wrote:
>
> I feel the following should work:
> class Myform(forms.Form):
> ...publ = forms.ChoiceField(label='Publisher', required=False)
>
> and then in handler I should be able to set the choices dynamically
> by:
>
> def meth(request):
> ...frm=Myform(initial={'publ':((1,2),(2,3),(3,4)))}) #even if the
> brackets are wrong here, they were right in the original

by initial argument, you are meant to pass the initial VALUE (which
choice is currently selected), choices on the other hand are part of
the field's definition...

if you want to setup the choices dynamically, set it in the form's
__init__ (search the list for examples, there were quite a few)
>
> An appropriate variant of the above certainly works for non ordinary
> CharFields.
>
> Any ideas would be appreciated.
>
> Paul Hide
>
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to