Am 29.01.2009 um 01:59 schrieb Malcolm Tredinnick:
> > On Wed, 2009-01-28 at 19:24 +0100, Florian Lindner wrote: >> >> Am 28.01.2009 um 05:19 schrieb Malcolm Tredinnick: >> >>> >>> On Tue, 2009-01-27 at 20:11 +0100, Florian Lindner wrote: >>>> Hello, >>>> >>>> I'm playing around with the contrib.comments framework. I want to >>>> change the preview form. For that I've copied preview.html to xgm/ >>>> Blog/ >>>> templates/comments (xgm is my project, Blog is app). My template >>>> loaders are: >>>> >>>> TEMPLATE_LOADERS = ( >>>> 'django.template.loaders.app_directories.load_template_source', >>>> 'django.template.loaders.filesystem.load_template_source', >>>> ) >>>> >>>> But modification I make to the preview.html in my app dir does not >>>> seem to be noticed. >>> >>> >>> For comments, if you're only wanting to change the preview form >>> for a >>> particular model or particular application, note that the template >>> loaded for preview is not comments/preview.html, always. That is the >>> name that is loaded is all else fails. However, the application >>> first >>> looks for >>> >>> comments/<app>_<model>_preview.html >>> comments/<app>_preview.html >>> >>> where <app> is the name of the application and <model> is the name >>> of >>> the model to which the comment is attached. If either of those >>> templates >>> are found, they are used for preference. So for an app-specific >>> customisation for an app called "foo", say, you could create >>> >>> comments/foo_preview.html >>> >>> in the foo/templates/ directory and it will be loaded for the >>> preview. >> >> Hi! >> >> Thanks for your answer. I decided to take the latter way. Thus I've >> copied preview.html to Blog_Entry_preview.html in the templates/ >> comments/ directory and it worked perfectly. I tried the same copying >> with the posted.html to Blog_Entry_posted.html but this does not >> work. >> My Blog_Entry_posted.html simply seems to be ignored. >> >> Any idea what I could have made wrong? I've double checked >> everything... > > So, for the future: It took about 30 seconds to grep through the > comments source (in django.contrib.comments) to find where posted.html > is used and see that it's doesn't allow that customisation (which is > also how I found that preview.html is the third of three things > checked). > > Remember, Django is in Python. The source is your friend. Ok, you're right. I've searched through Google but didn't got the idea to grep the code. My apologies. Is there any reason why this lookup is not implemented for all comments templates? If not I'll try to create a patch and commit into the ticket system. Regards, Florian. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---