Permalink
Browse files

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...
1 parent 8a98060 commit 5bb56520a5ad39396c7dd66e480040a701ede100 @adrianholovaty adrianholovaty committed Aug 6, 2005
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/views/admin/main.py
@@ -942,7 +942,7 @@ def change_stage(request, app_label, module_name, object_id):
if f.editable and f != rel_field:
for field_name in f.get_manipulator_field_names(''):
full_field_name = '%s.%d.%s' % (var_name, i, field_name)
- collection[field_name] = formfields.FormFieldWrapper(manipulator[full_field_name], new_data.get(full_field_name, ''), errors.get(full_field_name, []))
+ collection[field_name] = formfields.FormFieldWrapper(manipulator[full_field_name], new_data.get(full_field_name, f.get_default()), errors.get(full_field_name, []))
wrapper.append(formfields.FormFieldCollection(collection))
setattr(form, rel_opts.module_name, wrapper)
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 comments on commit 5bb5652

Please sign in to comment.