mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
Made the semi-private _max_form_count live on the public API of formsets by renaming it to max_num. This also removes the ManagementForm use of MAX_COUNT since that usage should just be referenced to the formset's max_num property. Refs #7899. Thanks Peter of the Norse for straightening me out.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -305,8 +305,8 @@ class BaseModelFormSet(BaseFormSet):
|
||||
queryset=None, **kwargs):
|
||||
self.queryset = queryset
|
||||
defaults = {'data': data, 'files': files, 'auto_id': auto_id, 'prefix': prefix}
|
||||
if self._max_form_count > 0:
|
||||
qs = self.get_queryset()[:self._max_form_count]
|
||||
if self.max_num > 0:
|
||||
qs = self.get_queryset()[:self.max_num]
|
||||
else:
|
||||
qs = self.get_queryset()
|
||||
defaults['initial'] = [model_to_dict(obj) for obj in qs]
|
||||
|
||||
Reference in New Issue
Block a user