mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #13524 -- Added backwards compatibility and feature notes regarding admin inlines and formsets. Thanks to Ramiro Morales and Gabriel Hurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -368,16 +368,22 @@ the creation of new inlines beyond max_num.
|
||||
|
||||
>>> AuthorFormSet = modelformset_factory(Author, max_num=None, extra=3)
|
||||
>>> formset = AuthorFormSet(queryset=qs)
|
||||
>>> len(formset.forms)
|
||||
6
|
||||
>>> len(formset.extra_forms)
|
||||
3
|
||||
|
||||
>>> AuthorFormSet = modelformset_factory(Author, max_num=4, extra=3)
|
||||
>>> formset = AuthorFormSet(queryset=qs)
|
||||
>>> len(formset.forms)
|
||||
4
|
||||
>>> len(formset.extra_forms)
|
||||
1
|
||||
|
||||
>>> AuthorFormSet = modelformset_factory(Author, max_num=0, extra=3)
|
||||
>>> formset = AuthorFormSet(queryset=qs)
|
||||
>>> len(formset.forms)
|
||||
3
|
||||
>>> len(formset.extra_forms)
|
||||
0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user