Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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(positional=True)
    fallback = ttag.Arg(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/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ttag-1.0-alpha-3.tar.gz (212.8 kB view details)

Uploaded Source

File details

Details for the file django-ttag-1.0-alpha-3.tar.gz.

File metadata

File hashes

Hashes for django-ttag-1.0-alpha-3.tar.gz
Algorithm Hash digest
SHA256 363e2ec2d595aa79869307c20c9def50f57de43b793453e25dd33d6856e305df
MD5 3c7b89167106210d9a710dbcfb8f9fc4
BLAKE2b-256 9f6447683bdddab521cccb7b1ff6fd578df3a128eaa3b4911a6a6dcbdef9ff91

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0

2 files

2.4

1 file

2.3

1 file

2.2

1 file

2.1.1

1 file

2.0

1 file

1.0

1 file

This release

1.0-alpha-3 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page