django-meio-easytags 0.7

An easy way to create custom template tags for Django's templating system.

django-meio-easytags

An easy way to create custom template tags for Django's templating system.

Usage

Just instantiate EasyLibrary and register the renderer method as a template tag:

from easytags import EasyLibrary

register = EasyLibrary()

def sum(context, arg1, arg2, arg3=0):
    return int(arg1) + int(arg2) + int(arg3)

register.easytag(sum)

The EasyLibrary will take care of subclassing EasyNode that will take care of the template tag's parsing, resolving variable and inspecting if the args are ok with the renderer signature. In the example above, you can use the sum tag in any of the forms below:

{% sum "1" "2" %}
{% sum "1" arg2="2" %}
{% sum arg1="1" arg2="2" %}
{% sum arg2="2" arg1="1" %}

It's almost like calling methods in Python.

In this example, arg3 is optional and defaults to 0. So you may use or not this arg.

BSD

Author

Vinicius Mendes

Pip

django-meio-easytags==0.7

Classifiers

  • Framework :: Django
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Development Status :: 4 - Beta
  • Natural Language :: English
  • License :: OSI Approved :: BSD License
  • Topic :: Software Development :: Libraries :: Python Modules
  • Topic :: Internet :: WWW/HTTP
File Type Python Version Uploaded On Downloads
django-meio-easytags-0.7.tar.gz Source June 29, 2011 3,793
Version Release Date
0.7 June 29, 2011
0.6 June 29, 2011
0.5 March 26, 2011
0.4 March 2, 2011
0.3 Feb. 27, 2011
0.2 Feb. 22, 2011
0.1 Feb. 21, 2011
Date Package Version Action
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.6 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.7 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.4 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.5 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.2 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.3 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags 0.1 Release Created
Aug. 26, 2015, 12:16 a.m. django-meio-easytags Package Created