Always loaded tempalte tags?

4 views
Skip to first unread message

je...@jeffcroft.com

unread,
Apr 24, 2007, 11:38:49 AM4/24/07
to Django developers
As someone who works with the Django template language eight+ hours a
day, I've built up quite a library of tags and filters that I use a
LOT. Like, in nearly every template. For example, I pass almost every
bit of text through a filter that applies Smartypants formatting (for
proper quotes and other typographical goodness). As you might expect,
nearly every template I create starts with the same three {% load ____
%} tags. I find this annoying.

Is there some way to add a template tag library to those that are
loaded at all times? If not, should there be? I'm all for only loading
what you really need, but I sincerely do need certain tags and filters
to be available at all times. Is this possible?

Thanks, guys!

Jeff

Mike Axiak

unread,
Apr 24, 2007, 10:02:51 PM4/24/07
to Django developers

oggie rob

unread,
Apr 24, 2007, 5:53:33 PM4/24/07
to Django developers
In 0.92 you could do this:
@defaulttags.register.simple_tag
def my_tag():
pass

Without looking (and probably regretting my laziness...) I'm guessing
the same is still available.

-rob

Reply all
Reply to author
Forward
0 new messages