There are no builds for this project.

Description

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." %}


Versions

Build a version

Repository

http://github.com/lincolnloop/django-ttag.git

Tags

templatetags, django

Last Built

2 years, 4 months ago

Home Page

https://github.com/lincolnloop/django-ttag

Project Privacy Level

Public

Short URLs

django-ttag.readthedocs.org
django-ttag.rtfd.org

Open Comparison

This project has more information available about it on Open Comparison!

Default Version

latest

'latest' Version

master