Commit 50e3aa03 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

Fixed #11735 -- Corrected an example of FormSet subclassing. Thanks to claudep for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13553 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 6ac4aba9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -595,8 +595,8 @@ Alternatively, you can create a subclass that sets ``self.queryset`` in

    class BaseAuthorFormSet(BaseModelFormSet):
        def __init__(self, *args, **kwargs):
            self.queryset = Author.objects.filter(name__startswith='O')
            super(BaseAuthorFormSet, self).__init__(*args, **kwargs)
            self.queryset = Author.objects.filter(name__startswith='O')

Then, pass your ``BaseAuthorFormSet`` class to the factory function::