| |
Django users |
Note that this sort of customisation does require you to read some Regards, --
> Hi,
> I use django admin to manage a table. There is a hyperlink for
> each object in the change_list template, which will bring me to the
> change_form template. I want to change that hyperlink and redirect it
> to another url to handle. I didn't want to customize the current
> change_form for this model because it is still used somewhere else.
> Anybody knows how to do it?
change_list.html template for just that application + model name
combination (since the admin interface tries to load a template under
admin/<app_name>/<model_name>/change_list.html as one of the options for
that page). Then you need to write a template that displays what you
would like, which possibly means duplicating a lot of the logic of the
original page and the template tags that construct it. With a bit of
tracing through the code (admin/templates/admin/change_list.html,
admin/tempates/admin/change_list_result.html,
admin/templatetags/admin_list.py, admin/views/main.py) it should be
quite possible to achieve what you want. Take your time and you'll get
there (or use newforms-admin or wait for newforms-admin to be merged
into trunk, both of which will be easier).
Python code and templates and do a bit of design work. There isn't a
step-by-step guide, so if you aren't up to being able to read the code a
bit, this probably isn't the right sort of customisation to be trying to
make.
Malcolm
Tolkien is hobbit-forming.
http://www.pointy-stick.com/blog/