Template engine too tightly tied to settings module.. (specifically TEMPLATE_DIRS)

2006-10-23 Thread Le Roux Bodenstein
I'm trying to do some form of skinning with Django's templating engine. Without going into too much detail, my project is kindof a service that powers multiple sites. Each site can have a skin inside a site-specific folder. These folders are not parallel to each other. for example: myapp/webroot

Django's templating engine too tightly tied to TEMPLATE_DIRS in settings module

2006-10-23 Thread Le Roux Bodenstein
I opened a ticket here: http://code.djangoproject.com/ticket/2949 If anyone is interested, I can explain in more detail why this is a problem and a proposed workaround I have in mind. I'm willing to write a patch if anyone is interested, but I can't see a way for doing this in a backwards-incompa

Re: greater_than and less_than template filters

2006-10-11 Thread Le Roux Bodenstein
Hmm. Just realised that truncatewords already adds the ... at the end.. Anyway, I wrote some filters (not tested extensively): from django.template import Library def gt(value, arg): "Returns a boolean of whether the value is greater than the argument" return value > int(arg) def lt(va

greater_than and less_than template filters

2006-10-11 Thread Le Roux Bodenstein
Hi I often want to check if the length of things inside templates are more than something. For example.. I want to display the first 10 words of a comment inside a listing. I can do {{comment.body|striptags|truncatewords:10}} but if the amount of words are more than 10, I want to display ... afte