update to pass data and files as kwargs

This commit is contained in:
Craig Blaszczyk 2011-09-02 11:57:48 +01:00
parent eef995a21c
commit e97cafabb6

View File

@ -212,7 +212,7 @@ class FormResource(Resource):
return None return None
if data is not None or files is not None: if data is not None or files is not None:
form_ = form(data, files) form_ = form(data=data, files=files)
else: else:
form_ = form() form_ = form()
@ -338,9 +338,9 @@ class ModelResource(FormResource):
if data is not None or files is not None: if data is not None or files is not None:
if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'): if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'):
# Bound to an existing model instance # Bound to an existing model instance
form_ = form(data, files, instance=self.view.model_instance) form_ = form(data=data, files=files, instance=self.view.model_instance)
else: else:
form_ = form(data, files) form_ = form(data=data, files=files)
else: else:
form_ = form() form_ = form()