Re: Custom filters failing with "no module"

2007-07-01 Thread Andrew R
Malcolm Tredinnick wrote: > On Tue, 2007-06-12 at 05:44 -0400, Andrew R wrote: >> I have to admit, though, that I think adding a custom filter should be as >> simple >> as this code alone: >> >>> from django.template import Library >>> >>> register = Library() >>> >>> @register.filter >>> def jav

Re: Custom filters failing with "no module"

2007-06-12 Thread Malcolm Tredinnick
On Tue, 2007-06-12 at 05:44 -0400, Andrew R wrote: > James Bennett wrote: > > So long as your code is in a location where your code can be imported > > by Python, there is another way; there are a couple of undocumented > > functions in the template system which handle the loading of tag > > libra

Re: Custom filters failing with "no module"

2007-06-12 Thread Andrew R
James Bennett wrote: > So long as your code is in a location where your code can be imported > by Python, there is another way; there are a couple of undocumented > functions in the template system which handle the loading of tag > libraries. > [snip] > So something like > > from django.temp

Re: Custom filters failing with "no module"

2007-06-09 Thread James Bennett
On 6/9/07, Andrew R <[EMAIL PROTECTED]> wrote: > I think a better long term solution is something like: > > Template.add_templatetags_file('filename.py') > So long as your code is in a location where your code can be imported by Python, there is another way; there are a couple of undocume

Re: Custom filters failing with "no module"

2007-06-09 Thread Andrew R
James Bennett wrote: > On 6/6/07, Andrew R <[EMAIL PROTECTED]> wrote: >> whereas I just want it to import "javadoc_filter" from my current dir. I'm >> sure >> this is by design in django but there must be a way around it. > > This is one of the tricky bits of Django that you don't often see. > D

Re: Custom filters failing with "no module"

2007-06-08 Thread James Bennett
On 6/6/07, Andrew R <[EMAIL PROTECTED]> wrote: > whereas I just want it to import "javadoc_filter" from my current dir. I'm > sure > this is by design in django but there must be a way around it. This is one of the tricky bits of Django that you don't often see. Django needs to have some consist

Custom filters failing with "no module"

2007-06-08 Thread Andrew R
All, I have a code generating program that using django's nifty template packages. It all worked well until I wanted to use a custom filter. No matter what I try, I get: django.template.TemplateSyntaxError: 'javadoc_filter' is not a valid tag library: Could not load template library from