mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[1.2.X] Fixed #11735 -- Corrected an example of FormSet subclassing. Thanks to claudep for the report.
Backport of r13553 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13560 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9e33599bc3
commit
d176d112b9
@ -595,8 +595,8 @@ Alternatively, you can create a subclass that sets ``self.queryset`` in
|
|||||||
|
|
||||||
class BaseAuthorFormSet(BaseModelFormSet):
|
class BaseAuthorFormSet(BaseModelFormSet):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.queryset = Author.objects.filter(name__startswith='O')
|
|
||||||
super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
|
super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
|
||||||
|
self.queryset = Author.objects.filter(name__startswith='O')
|
||||||
|
|
||||||
Then, pass your ``BaseAuthorFormSet`` class to the factory function::
|
Then, pass your ``BaseAuthorFormSet`` class to the factory function::
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user