Ticket #20849: lazy_model_form.diff
File lazy_model_form.diff, 627 bytes (added by , 11 years ago) |
---|
-
django/forms/models.py
diff --git a/django/forms/models.py b/django/forms/models.py index a5b82e5..2dd8751 100644
a b def model_to_dict(instance, fields=None, exclude=None): 133 133 data[f.name] = [] 134 134 else: 135 135 # MultipleChoiceWidget needs a list of pks, not object instances. 136 data[f.name] = list(f.value_from_object(instance).values_list('pk', flat=True))136 data[f.name] = [v.pk for v in f.value_from_object(instance)] 137 137 else: 138 138 data[f.name] = f.value_from_object(instance) 139 139 return data