django-classy-tags 0.6.2

Class based template tags for Django

Please refer to the documentation in the docs/ directory for help. For a HTML rendered version of it please see here.

About this project

The goal of this project is to create a new way of writing Django template tags which is fully compatible with the current Django templating infrastructure. This new way should be easy, clean and require as little boilerplate code as possible while still staying as powerful as possible.

Features

  • Class based template tags.
  • Template tag argument parser.
  • Declarative way to define arguments.
  • Supports (theoretically infinite) parse-until blocks.
  • Extensible!

For the impatient

This is how a tag looks like using django-classy-tags:

from classytags.core import Options
from classytags.helpers import AsTag
from classytags.arguments import Argument
from django import template

register = template.Library()

class Hello(AsTag):
    options = Options(
        Argument('name', required=False, default='world'),
        'as',
        Argument('varname', required=False, resolve=False)
    )

    def get_value(self, context, name):
        return 'hello %s' % name

register.tag(Hello)

That's your standard hello world example. Which can be used like this:

  • {% hello %}: Outputs hello world
  • {% hello "classytags" %}: Outputs hello classytags
  • {% hello as myvar %}: Outputs nothing but stores hello world into the template variable myvar.
  • {% hello "my friend" as othervar %}: Outputs nothing but stores hello my friend into the template variable othervar.

Author

Jonas Obrist

Pip

django-classy-tags==0.6.2

Classifiers

  • Development Status :: 5 - Production/Stable
  • Framework :: Django
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3.2
  • Programming Language :: Python :: 3.3
  • Natural Language :: English
  • Topic :: Utilities
  • License :: OSI Approved :: BSD License
  • Topic :: Software Development :: Libraries :: Python Modules
  • Programming Language :: Python :: 2.5
  • Topic :: Internet :: WWW/HTTP :: Dynamic Content
  • Topic :: Text Processing :: Markup :: HTML
File Type Python Version Uploaded On Downloads
django_classy_tags-0.6.2-py2-none-any.whl Wheel 2.7 June 11, 2015 55,702
django-classy-tags-0.6.2.tar.gz Source June 11, 2015 30,559
Version Release Date
0.6.2 June 11, 2015
0.6.1 Jan. 30, 2015
0.6.0 Aug. 24, 2015
0.5.2 Dec. 11, 2014
0.5.1 April 7, 2014
0.5 Feb. 28, 2014
0.4 Jan. 18, 2013
0.3.5 Feb. 28, 2014
0.3.4.1 Aug. 11, 2011
0.3.4 Aug. 11, 2011
0.3.3.1 April 10, 2011
0.3.3 March 3, 2011
0.3.2 March 2, 2011
0.3.1 March 2, 2011
0.3.0 Dec. 16, 2010
0.2.2 Sept. 12, 2010
0.2.1 Sept. 11, 2010
0.2.0 Sept. 11, 2010
0.1.3 Aug. 24, 2010
0.1.2 Aug. 23, 2010
0.1.1 Aug. 11, 2010
0.1.0 Aug. 10, 2010
Date Package Version Action
Aug. 24, 2015, 11 p.m. django-classy-tags 0.6.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.3 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.3.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.5.2 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.5.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.4.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.5 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.4 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.0 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.6.2 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.3.2 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.1.3 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.1.2 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.1.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.1.0 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.2.0 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.2.1 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.2.2 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.4 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.5 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags 0.6.0 Release Created
Aug. 24, 2015, 11 p.m. django-classy-tags Package Created