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 ModelChoiceField,
> or to write an __init__ method on the form which generates the choices
> on creation of an *instance* of the form.

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)]

But I only got the following error messages,
]  File "/home/blah...blah..../forms.py", line 73, in __init__
]    in models.User.objects.filter(type__gte=models.User.DEVELOPER)]
] AttributeError: 'IssueFilterForm' object has no attribute
'assigned_to'

Surely, there is "assigned_to" field in IssueFilterForm class.
]    assigned_to = forms.MultipleChoiceField(label='assignee',
required=False,
]
widget=forms.CheckboxSelectMultiple)

Now, what should I do to load choices dymanical?
(I think this is because of lack of my knowlege about Python. I
started programming Python a month ago).

Regards,
KwonNam.


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