django-templatetag-sugar 1.0

A library to make Django's template tags sweet.

A library to make writing templatetags in Django sweet.

Here's an example of using:

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.

BSD

Author

Alex Gaynor

Pip

django-templatetag-sugar==1.0

Classifiers

  • Environment :: Web Environment
  • Framework :: Django
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Programming Language :: Python :: 2
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.2
  • Programming Language :: Python :: 3.3
  • Programming Language :: Python :: 3.4
  • License :: OSI Approved :: BSD License
  • Programming Language :: Python :: Implementation :: CPython
  • Programming Language :: Python :: Implementation :: PyPy
File Type Python Version Uploaded On Downloads
django_templatetag_sugar-1.0-py2.py3-none-any.whl Wheel py2.py3 March 24, 2014 45,063
django-templatetag-sugar-1.0.tar.gz Source March 24, 2014 18,301
Version Release Date
1.0 March 24, 2014
0.1 May 24, 2010
Date Package Version Action
Aug. 26, 2015, 12:28 a.m. django-templatetag-sugar 1.0 Release Created
Aug. 26, 2015, 12:28 a.m. django-templatetag-sugar 0.1 Release Created
Aug. 26, 2015, 12:28 a.m. django-templatetag-sugar Package Created