mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Added support for specifying initial values to model formsets and inline formsets.
This make them consistent with the similar capability of regular formsets. Thanks to simon29 form the report and to Claude Paroz for the patch. Fixes #14574. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -122,7 +122,7 @@ class BaseFormSet(StrAndUnicode):
|
||||
if self.is_bound:
|
||||
defaults['data'] = self.data
|
||||
defaults['files'] = self.files
|
||||
if self.initial:
|
||||
if self.initial and not 'initial' in kwargs:
|
||||
try:
|
||||
defaults['initial'] = self.initial[i]
|
||||
except IndexError:
|
||||
|
||||
Reference in New Issue
Block a user