dts

django-templatetag-sugar

This project exists to make defining template tags in Django kickass

Showing:

Popularity

Downloads/wk

0

GitHub Stars

213

Maintenance

Last Commit

7yrs ago

Contributors

3

Package

Dependencies

0

License

BSD

Categories

Readme

django-templatetag-sugar

A library to make writing templatetags in Django sweet.

Here's an example of using:

.. code-block:: python

from django import template

from templatetag_sugar.register import tag
from templatetag_sugar.parser import Name, Variable, Constant, Optional, Model

register = template.Library()

@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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100