Maybe overloading add_view() on ModelAdmin class would be the right
direction to go.
class OrderAdmin(ModelAdmin)
def add_view(self, request, *a, **k):
p_id = get_product_id(request)
super(OrderAdmin).add_view(request, extra_context = {'p_id': p_id}, *a, **k)
A.
On Fri, Feb 6, 2009 at
I'd like to pass a variable to a django admin view to preset some
fields on an 'Add a product' form.
Example:
An order has come in for 10 Pearl Jam CDs - I have a url that points
to /admin/order/add/ to give the admin staff access to 'create a new
order'. Fine, works great - ideally I want to
2 matches
Mail list logo