Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckboxSelectMultiple fails when the queryset is empty #162

Open
subramanyamVemu opened this issue Oct 5, 2015 · 1 comment
Open

CheckboxSelectMultiple fails when the queryset is empty #162

subramanyamVemu opened this issue Oct 5, 2015 · 1 comment

Comments

@subramanyamVemu
Copy link

With the following in forms.py
from django.forms.widgets import CheckboxSelectMultiple

forms.ModelMultipleChoiceField(queryset=None, widget=CheckboxSelectMultiple())

The widget fails to load for an emptyqueryset

Thanks

@gregmuellegger
Copy link
Collaborator

Hi, can you post the exact error message you get?
I think you should use MyModel.objects.all().none() which will return a proper empty queryset. None is not a queryset and therefore unexpected as the parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants