From 5bb56520a5ad39396c7dd66e480040a701ede100 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 6 Aug 2005 20:51:06 +0000 Subject: [PATCH] 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 --- django/views/admin/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/views/admin/main.py b/django/views/admin/main.py index 42aa36b9f8d..c6ff36bf46e 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: