django-ttag 2.4

A template tag constructor library for Django.

TTag is a template tag constructor library for Django created for the purpose of making writing template tags easier.

The tag syntax is modelled on Django's friendly syntaxes for models and forms. Here is a full example tag:

class Welcome(ttag.Tag)
    user = ttag.Arg()
    fallback = ttag.Arg(named=True, default='Hi!')

    def output(self, data)
        name = data['user'].get_full_name()
        if name:
            return 'Hi, %s!' % name
        return data['fallback']

This would produce a tag named welcome which can be used like this:

{% welcome current_user fallback "Hello, anonymous." %}

More comprehensive usage and reference documentation can be found in the docs directory, or at http://packages.python.org/django-ttag/.

MIT

Author

Chris Beaven

Pip

django-ttag==2.4

Classifiers

  • Programming Language :: Python
  • Operating System :: OS Independent
  • License :: OSI Approved :: BSD License
  • Intended Audience :: Developers
  • Framework :: Django
  • Environment :: Web Environment
  • Development Status :: 4 - Beta
File Type Python Version Uploaded On Downloads
django-ttag-2.4.tar.gz Source Nov. 16, 2011 12,634
Version Release Date
2.4 Nov. 16, 2011
2.3 Sept. 7, 2011
2.2 Aug. 3, 2011
2.1.1 July 28, 2011
2.0 July 5, 2011
1.0 May 27, 2011
1.0-alpha-4 April 1, 2011
1.0-alpha-3 March 2, 2011
1.0-alpha-2 Feb. 1, 2011
1.0-alpha Dec. 13, 2010
Date Package Version Action
Nov. 4, 2014, 2 p.m. django-ttag 2.4 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 1.0-alpha-4 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 2.1.1 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 1.0-alpha-2 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 2.2 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 2.3 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 1.0-alpha Release Created
Nov. 4, 2014, 2 p.m. django-ttag 1.0-alpha-3 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 1.0 Release Created
Nov. 4, 2014, 2 p.m. django-ttag 2.0 Release Created
Nov. 4, 2014, 2 p.m. django-ttag Package Created