Message from discussion
How to overwrite the hyperlink of objects in change list template of django admin?
Received: by 10.35.59.5 with SMTP id m5mr12238435pyk.0.1208222533592;
Mon, 14 Apr 2008 18:22:13 -0700 (PDT)
Return-Path: <malc...@pointy-stick.com>
Received: from bigben2.bytemark.co.uk (bigben2.bytemark.co.uk [80.68.81.132])
by mx.google.com with ESMTP id z53si5407239pyg.1.2008.04.14.18.22.12;
Mon, 14 Apr 2008 18:22:13 -0700 (PDT)
Received-SPF: neutral (google.com: 80.68.81.132 is neither permitted nor denied by best guess record for domain of malc...@pointy-stick.com) client-ip=80.68.81.132;
Authentication-Results: mx.google.com; spf=neutral (google.com: 80.68.81.132 is neither permitted nor denied by best guess record for domain of malc...@pointy-stick.com) smtp.mail=malc...@pointy-stick.com
Received: from sharp.pointy-stick.com ([80.68.90.23])
by bigben2.bytemark.co.uk with esmtp (Exim 4.63)
(envelope-from <malc...@pointy-stick.com>)
id 1JlZsB-0007Dn-PF
for django-users@googlegroups.com; Tue, 15 Apr 2008 01:22:11 +0000
Received: from [192.168.0.102] (cust7071.nsw01.dataco.com.au [203.171.88.159])
by sharp.pointy-stick.com (Postfix) with ESMTP id 26DC6C406
for <django-users@googlegroups.com>; Tue, 15 Apr 2008 11:22:09 +1000 (EST)
Subject: Re: How to overwrite the hyperlink of objects in change list
template of django admin?
From: Malcolm Tredinnick <malc...@pointy-stick.com>
To: django-users@googlegroups.com
In-Reply-To: <d35b1bf1-d60f-4d5f-89bc-0deb6dabc43c@q10g2000prf.googlegroups.com>
References:
<3ca3f9dd-63c0-417c-82ad-7bd290114...@t12g2000prg.googlegroups.com>
<1208136189.27246.3.ca...@counterweight.tredinnick.org>
<d35b1bf1-d60f-4d5f-89bc-0deb6dabc...@q10g2000prf.googlegroups.com>
Content-Type: text/plain
Date: Tue, 15 Apr 2008 11:22:02 +1000
Message-Id: <1208222522.27246.55.camel@counterweight.tredinnick.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8)
Content-Transfer-Encoding: 7bit
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/