I'm having a strange issue with a pair of ManyToManyFields, where they're 
acting like they're required fields in the admin even though they're not.


# In models.py
    instructors = models.ManyToManyField(Instructor, blank=True)
    students = models.ManyToManyField(Profile, blank=True)



I can update an instance of this model with no instructors or students from 
the CLI just fine. The fields are not required. But I'm using 
ModelMultipleChoiceField in the admin:


# In admin.py
class OfferingAdminForm(forms.ModelForm):

    instructors = forms.ModelMultipleChoiceField(
        widget = widgets.FilteredSelectMultiple('Instructors',is_stacked=
False),
        queryset = Instructor.objects.all())


    students = forms.ModelMultipleChoiceField(
        widget = widgets.FilteredSelectMultiple('Students',is_stacked=False
),
        queryset = User.objects.filter(is_active=True))

and when I try to save via the admin, it tells me these fields are 
required. If I tweak it to not use this ModelForm, I can save without 
instructors or students just fine. 

Theories? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b99c64ec-d6af-4716-8d86-5f93bd00af0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to