Re: newforms select field

2007-02-18 Thread paulh
As far as I can see the __init__ way of doing things creates a field as opposed to a base_field. Given that this is done in the __init__ method every instance will have this field. Is there any disadvantage in this? I suppose you could also have a base_field with the same name/ key. Looking at

Re: newforms select field

2007-02-18 Thread Honza Král
On 2/18/07, paulh <[EMAIL PROTECTED]> wrote: > > Thanks for the replies. As always, reading the docs again teaches you > a bit more than the first time; I now see that that initial was not > what I was after. > > Arnaud, I think your method is more what I was after and as you say, > it does

Re: newforms select field

2007-02-18 Thread paulh
Thanks for the replies. As always, reading the docs again teaches you a bit more than the first time; I now see that that initial was not what I was after. Arnaud, I think your method is more what I was after and as you say, it does exactly what I wanted. It seems to be much simpler than

Re: newforms select field

2007-02-17 Thread Arnaud Delobelle
On Feb 17, 7:05 pm, "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): >

Re: newforms select field

2007-02-17 Thread Honza Král
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): >

newforms select field

2007-02-17 Thread paulh
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