Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2899: added defaults for data and error_dict params to FormWra…

…pper. Thanks, john@sneeu.com.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 644af2213d4e3be19626a604ab2d315ec19f426c 1 parent b6a1789
@jacobian jacobian authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/forms/__init__.py
View
9 django/forms/__init__.py
@@ -108,8 +108,13 @@ class FormWrapper(object):
This allows dictionary-style lookups of formfields. It also handles feeding
prepopulated data and validation error messages to the formfield objects.
"""
- def __init__(self, manipulator, data, error_dict, edit_inline=True):
- self.manipulator, self.data = manipulator, data
+ def __init__(self, manipulator, data=None, error_dict=None, edit_inline=True):
+ self.manipulator = manipulator
+ if data is None:
+ data = {}
+ if error_dict is None:
+ error_dict = {}
+ self.data = data
self.error_dict = error_dict
self._inline_collections = None
self.edit_inline = edit_inline
Please sign in to comment.
Something went wrong with that request. Please try again.