Re: Default values/prepopulate fields in ModelAdmin add view

2008-10-24 Thread Delta20
In case anyone else is trying to figure out how to do this, the solution I came up with was to put a dictionary of the values into the request and pass it to the ModelAdmin add_view function def some_view(request, ... ): ... values = { 'title': t, 'author': a } # make QueryDict mutabl

Default values/prepopulate fields in ModelAdmin add view

2008-10-23 Thread Delta20
I want to be able to use the standard/auto-generated admin add form, but need to put default values in the fields. Is this possible? Basically I want to do something like this in a view: 1: def some_view(request, ... ): 2: ... 3: values = { 'title': t, 'author': a } 4: admin = ne