#21155: Changing queryset of Model formsets in __init__ doesn't work
-------------------------------+------------------------------------
Reporter: yofee | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.5
Severity: Normal | Keywords: ModelFormSet, queryset
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
In the [https://docs.djangoproject.com/en/1.5/topics/forms/modelforms
/#changing-the-queryset documentation] it says you could change the
queryset of a Model formset by setting it in the `__init__` method:
{{{
class BaseAuthorFormSet(BaseModelFormSet):
def __init__(self, *args, **kwargs):
super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
self.queryset = Author.objects.filter(name__startswith='O')
}}}
But in Django 1.5 it doesn't work. It was fixed in some former versions :
#17478 (Django 1.3) and #11735 (Django 1.1)
--
Ticket URL: <https://code.djangoproject.com/ticket/21155>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.a83741375fbc9e58d6fbb108e6de154e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.