I had this:

disciplines = forms.ModelMultipleChoiceField(queryset =
Discipline.objects.all())

But if new Disciplines are created during runtime they do not appear
on the list when a new form is rendered.   There doesn't seem to be a
mention of that fact in the documentation.

So is it correct that to get a current list you must do the following:

disciplines = forms.ModelMultipleChoiceField(queryset = None)

def __init__(self, *args, **kwargs):
        super(MyForm, self).__init__(*args, **kwargs)

        self.fields['disciplines'].queryset = Discipline.objects.all()

Thanks

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to