1
0
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:
Ramiro Morales
2012-01-15 01:36:14 +00:00
parent 4e29b70b9d
commit e308cfc0e1
6 changed files with 48 additions and 3 deletions

View File

@@ -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: