Re: Overriding ModelForm field's value in the admin changeview

2010-08-16 Thread vjimw
The form and object are combined when you call: response = super([YOURMODELFORMHERE], self).change_view(request, object_id, extra_context=my_context) You can see what the admin code for def change_view does in Django1.*/ django/contrib/admin/options.py I was looking at the same thing and found a

Overriding ModelForm field's value in the admin changeview

2010-07-14 Thread Chuck Harmston
Does anyone know where in the admin changeview the fields in a ModelForm is populated with the information from the database? I was hoping to override one of the fields in a subclassed ModelForm.__init__(), e.g.: self.base_fields[field_name].initial = 'foo' But the population appears to be happen