On Thu, 09 Feb 2006 03:13:04 +0200, Colleen Owens <[EMAIL PROTECTED]> wrote:

Again, what I'm trying to do is customize the way inline-edited objects
are displayed for one of my applications (without affecting any other
application).

First I changed line 52 of
django/contrib/admin/templates/admin/change_form.html to read:

{% for related_object in bound_manipulator.inline_related_objects %}{%
block related_object_display %}{% edit_inline related_object %}{%
endblock %}{% endfor %}

(i.e. I added the block and endblock tags).

Then I created another change_form.html file in my template directory
that simply contains:

{% extends "admin/change_form" %}
{% block related_object_display %}{% include
"admin/news/edit_news_inline" %}{% endblock %}

admin/news/edit_news_inline simply points to my custom template that
contains the code I want. I'll customize the url rewrite to point to
the default change_form for all applications, but my news application
will point to my new change_form.

Does this seem like a reasonable way to do this? I still don't quite
have a handle on all this so sometimes I feel like I'm doing things in
a very convoluted way.


There is a simple way to create special admin templates for one object.
See http://code.djangoproject.com/wiki/NewAdminChanges#Adminconvertedtoseparatetemplates

HTH,
Edgars

Reply via email to