On Sat, Nov 1, 2008 at 5:54 PM, Lars Stavholm <[EMAIL PROTECTED]> wrote:

>
> Low Kian Seong wrote:
> > http://www.djangobook.com/en/1.0/chapter17/
>
> Yes, thank you, that's it.
>
> It worked nicely for the change_form.html example given in that
> chapter. However, for the change_list.html it still doesn't work.
> Seems to me I've hit a django bug. Anyone else?
>

I just tried this, and it works for me for change_list.html. So I'm not sure
what is going on in your case.  For me it just works, overriding change_list
on a per-model basis using a file:

templates/admin/<app_name>/<model_name>/change_list.html

Karen


> /L
>
> > On Sat, Nov 1, 2008 at 6:20 PM, Lars Stavholm <[EMAIL PROTECTED]> wrote:
> >> Low Kian Seong wrote:
> >>> You are supposed to put the admin template you want to override in
> >>> your own template directory definition in settings.py
> >>>
> >>> So, if you defined it as /home/stava/<project
> >>> name>/template/admin/change_list.html
> >> Huh?
> >> /L
> >>
> >>> On Sat, Nov 1, 2008 at 5:32 PM, Lars Stavholm <[EMAIL PROTECTED]>
> wrote:
> >>>> I'd like to override part of an admin change_list template.
> >>>>
> >>>> Reading the documentation, my understanding is that I can place
> >>>> a template in a certain place in the templates directory hierarchy,
> >>>> and django will look for it and use it, i.e.:
> >>>>
> >>>> templates/admin/build/job/change_list.html
> >>>>
> >>>> ...where "build" is my application and "job" is my model class.
> >>>>
> >>>> The change_list.html file only contains the part I want to override,
> >>>> i.e. the extrahead block. It contains:
> >>>>
> >>>> {% extends "admin/change_list.html" %}
> >>>> {% block extrahead %}
> >>>>   <META HTTP-EQUIV=REFRESH CONTENT=10>
> >>>> {% endblock %}
> >>>>
> >>>> However, this does not work for me, so I'm expecting it to be some
> >>>> mistake on my part, I just can't figure out what the mistake is.
> >>>>
> >>>> Now, if I put the file in ./templates/admin/build/change_list.html
> >>>> it still wont work. On the other hand, this would be overriding all
> >>>> "build" application change lists, which is not what I was looking for.
> >>>>
> >>>> Only way I've found is to copy the change_list.html from the django
> >>>> installation in contrib/admin/templates/admin, and then modify it to
> >>>> my needs, using "if" statements to figure out which application model
> >>>> class is being rendered, and the put the change_list.html in my app's
> >>>> templates/admin directory, which doesn't feel right.
> >>>>
> >>>> Any input appreciated
> >>>> /Lars Stavholm
> >>>>
> >>>>
> >>
> >>
> >
> >
> >
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to