Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1101 from erikr/master

Fixed argument order for localized_fields to ensure backwards compatibility
  • Loading branch information...
commit e0df647143dd595aba0e9f077703775a226d015f 2 parents cac7b44 + 1c16956
Florian Apolloner authored May 18, 2013

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/forms/models.py
6  django/forms/models.py
@@ -136,7 +136,7 @@ def model_to_dict(instance, fields=None, exclude=None):
136 136
             data[f.name] = f.value_from_object(instance)
137 137
     return data
138 138
 
139  
-def fields_for_model(model, fields=None, exclude=None, widgets=None, localized_fields=None, formfield_callback=None):
  139
+def fields_for_model(model, fields=None, exclude=None, widgets=None, formfield_callback=None, localized_fields=None):
140 140
     """
141 141
     Returns a ``SortedDict`` containing form fields for the given model.
142 142
 
@@ -246,7 +246,7 @@ def __new__(cls, name, bases, attrs):
246 246
                 opts.fields = None
247 247
 
248 248
             fields = fields_for_model(opts.model, opts.fields, opts.exclude,
249  
-                                      opts.widgets, opts.localized_fields, formfield_callback)
  249
+                                      opts.widgets, formfield_callback, opts.localized_fields)
250 250
 
251 251
             # make sure opts.fields doesn't specify an invalid field
252 252
             none_model_fields = [k for k, v in six.iteritems(fields) if not v]
@@ -413,7 +413,7 @@ class ModelForm(six.with_metaclass(ModelFormMetaclass, BaseModelForm)):
413 413
     pass
414 414
 
415 415
 def modelform_factory(model, form=ModelForm, fields=None, exclude=None,
416  
-                      localized_fields=None, widgets=None, formfield_callback=None):
  416
+                      formfield_callback=None, widgets=None, localized_fields=None):
417 417
     """
418 418
     Returns a ModelForm containing form fields for the given model.
419 419
 

0 notes on commit e0df647

Please sign in to comment.
Something went wrong with that request. Please try again.