Ticket #4727: newforms-admin-5559-allow-form-base-override.diff
File newforms-admin-5559-allow-form-base-override.diff, 1.8 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/options.py
162 162 filter_vertical = () 163 163 filter_horizontal = () 164 164 inlines = [] 165 base_form = forms.BaseForm 165 166 166 167 def __init__(self, model): 167 168 self.model = model … … 412 413 # Object list will give 'Permission Denied', so go back to admin home 413 414 post_url = '../../../' 414 415 415 ModelForm = forms.form_for_model(model, form field_callback=self.formfield_for_dbfield)416 ModelForm = forms.form_for_model(model, form=self.base_form, formfield_callback=self.formfield_for_dbfield) 416 417 417 418 inline_formsets = [] 418 419 if request.POST: … … 465 466 if request.POST and request.POST.has_key("_saveasnew"): 466 467 return self.add_view(request, form_url='../../add/') 467 468 468 ModelForm = forms.form_for_instance(obj, form field_callback=self.formfield_for_dbfield)469 ModelForm = forms.form_for_instance(obj, form=self.base_form, formfield_callback=self.formfield_for_dbfield) 469 470 470 471 inline_formsets = [] 471 472 if request.POST: -
django/contrib/admin/templates/admin/change_form.html
38 38 {% if adminform.form.errors %} 39 39 <p class="errornote"> 40 40 {% blocktrans count adminform.form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 41 {{ adminform.form.non_field_errors }} 41 42 </p> 42 43 {% endif %} 43 44