Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #270 -- Admin change forms now display default values in num_ex…

…tra_on_change fields with default set. Thanks for the patch, Hugo

git-svn-id: http://code.djangoproject.com/svn/django/trunk@418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5bb56520a5ad39396c7dd66e480040a701ede100 1 parent 8a98060
Adrian Holovaty authored August 06, 2005

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/views/admin/main.py
2  django/views/admin/main.py
@@ -942,7 +942,7 @@ def change_stage(request, app_label, module_name, object_id):
942 942
                 if f.editable and f != rel_field:
943 943
                     for field_name in f.get_manipulator_field_names(''):
944 944
                         full_field_name = '%s.%d.%s' % (var_name, i, field_name)
945  
-                        collection[field_name] = formfields.FormFieldWrapper(manipulator[full_field_name], new_data.get(full_field_name, ''), errors.get(full_field_name, []))
  945
+                        collection[field_name] = formfields.FormFieldWrapper(manipulator[full_field_name], new_data.get(full_field_name, f.get_default()), errors.get(full_field_name, []))
946 946
             wrapper.append(formfields.FormFieldCollection(collection))
947 947
         setattr(form, rel_opts.module_name, wrapper)
948 948
         if rel_opts.order_with_respect_to and rel_opts.order_with_respect_to.rel and rel_opts.order_with_respect_to.rel.to == opts:

0 notes on commit 5bb5652

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