Go to Google Groups Home    Django users
Re: How to overwrite the hyperlink of objects in change list template of django admin?

Malcolm Tredinnick <malc...@pointy-stick.com>

On Mon, 2008-04-14 at 04:04 -0700, Leon wrote:
> I've tried that method and make my own object list in the customized
> change_list.html.
> That REALLY duplicate a lot of works. Is it possible to add a hook
> function (middleware?) just
> before the change_list template being rendered?

You're really asking, in general, whether it's possible to make the
admin interface more customisable. Yes there is and through the
advantage of owning a time machine, we've already done it in the
newforms-admin branch. Not sure if your precise problem is addressed
specifically there, but most customisations are easier. That's on track
to be merged with trunk "soon", so it's not worth worrying too much
about anything with existing admin beyond just getting something to work
at the moment.

>  In that way, I might
> be able to modify the
> data before it is passed to template.

> I had expected there is a magic function in model class to change it. :
> (

Why? Models represent data storage not presentation. The new admin
actually moves all of the admin stuff out of the model as part of being
more consistent in that area (along with a bunch of other benefits like
allowing multiple admin setups for a model).

Regards,
Malcolm

--
Always try to be modest and be proud of it!
http://www.pointy-stick.com/blog/