Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread KwonNam Son
Thank you James. I solved the problem like the following. def __init__(self, data=None, auto_id='id=%s', prefix=None, initial=None): super(DynamicForm, self).__init__(data, auto_id, prefix, initial) self.fields['dynamic_field'].choices = [(dynamic.id, dynamic.nickname) for dyn

Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > I tried the following in a Form class ... > > ]def __init__(self, **kwargs): > ]super(IssueFilterForm, self).__init__(**kwargs) > ]self.assigned_to.choices = [(assignee.id, assignee.nickname) > for assignee > ]

Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread Mambaragi
Thank you for the quick answer. > > as you see, choices are dynamically generated. Actually, I meant -> as you see, "I expected" choices to be generated dynamically. I made a lot of mistakes because of my poor English. anyway... > remains in memory. What you want instead is to use a ModelChoi

Re: newforms MultipleChoiceField caches the first data

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > widget=forms.CheckboxSelectMultiple, > choices=[(assignee.id, > assignee.nickname) for assignee >in > models.User.objects.filter(type__gte=models.User.DE

newforms MultipleChoiceField caches the first data

2007-07-10 Thread Mambaragi
I use newforms for dynamic form. Here's one of the fields. assigned_to = forms.MultipleChoiceField(label='담당자', required=False, widget=forms.CheckboxSelectMultiple, choices=[(assignee.id, assignee.nickname) for assignee