This project exists to make defining template tags in Django kickass
Python
Pull request Compare This branch is 1 commit ahead, 18 commits behind alex:master.
Permalink
Failed to load latest commit information.
templatetag_sugar
.gitignore
LICENSE
README
setup.py

README

django-templatetag-sugar
===========================

A library to make writing templatetags in Django sweet.

Here's an example of using::

    @tag(register, [Constant("for"), Variable(), Optional([Constant("as"), Name()])]):
    def example_tag(context, val, asvar=None):
        if asvar:
            context[asvar] = val
            return ""
        else:
            return val


As you can see it makes it super simple to define the syntax for a tag.