public
Description: This project exists to make defining template tags in Django kickass
Homepage:
Clone URL: git://github.com/alex/django-templatetag-sugar.git
bmihelac (author)
Tue Nov 17 01:37:52 -0800 2009
alex (committer)
Tue Nov 17 08:11:29 -0800 2009
commit  8083de7f01a5cf00666fd817dfd9e24798b6136c
tree    9599cb9d5abe2ab45d23446378c8642dda1b05ba
parent  1899685b76bce140d8b1680563c0dad29604b501
name age message
file .gitignore Fri Nov 06 15:26:31 -0800 2009 Initial commit [alex]
file LICENSE Sat Nov 07 16:21:29 -0800 2009 Renamed the project to django-templatetag-sugar [alex]
file README Sat Nov 07 16:21:29 -0800 2009 Renamed the project to django-templatetag-sugar [alex]
file setup.py Sat Nov 07 16:22:39 -0800 2009 Update the URL for the move. [alex]
directory templatetag_sugar/ Tue Nov 17 08:11:29 -0800 2009 Added tests for strings as variables and option... [bmihelac]
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.