summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-08-06 20:51:06 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-08-06 20:51:06 +0000
commit5bb56520a5ad39396c7dd66e480040a701ede100 (patch)
tree39e392c8f661e7297b4156083919a75ab37491da
parent8a9806096fb36c2cd9df623c8d5d0fbc29a08b0d (diff)
Fixed #270 -- Admin change forms now display default values in num_extra_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
-rw-r--r--django/views/admin/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/views/admin/main.py b/django/views/admin/main.py
index 42aa36b9f8..c6ff36bf46 100644
--- a/django/views/admin/main.py
+++ b/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: