Ticket #8357: 8357.diff
File 8357.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/templatetags/admin_modify.py
8 8 the prepopulated fields for both the admin form and inlines. 9 9 """ 10 10 prepopulated_fields = [] 11 if context["add"] :11 if context["add"] and getattr(context, 'adminform', False): 12 12 prepopulated_fields.extend(context["adminform"].prepopulated_fields) 13 for inline_admin_formset in context['inline_admin_formsets']: 14 for inline_admin_form in inline_admin_formset: 15 if inline_admin_form.original is None: 16 prepopulated_fields.extend(inline_admin_form.prepopulated_fields) 13 if getattr(context, 'inline_admin_formsets', False): 14 for inline_admin_formset in context['inline_admin_formsets']: 15 for inline_admin_form in inline_admin_formset: 16 if inline_admin_form.original is None: 17 prepopulated_fields.extend(inline_admin_form.prepopulated_fields) 17 18 context.update({"prepopulated_fields": prepopulated_fields}) 18 19 return context 19 20 prepopulated_fields_js = register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)(prepopulated_fields_js)