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 dynamic
                           in models.Dynamics.objects.all()]

I think this topic should be included in the
http://www.djangoproject.com/documentation/newforms/ document. This kind
dynamic forms are needed a lot.

Regards,
KwonNam.

2007/7/10, James Bennett <[EMAIL PROTECTED]>:
>
>
> 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
> > ]                           in
> > models.User.objects.filter(type__gte=models.User.DEVELOPER)]
>
> You want to be assigning to self.fields['assigned_to'].choices, not
> self.assigned_to.choices.
>
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>


-- 
* 까먹지말자! http://kwon37xi.egloos.com

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