Skip to main content

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/.

Release files for django-ttag 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ttag 2.0
File Size Uploaded
django-ttag-2.0.tar.gz 227.2 kB Details

Release files / django-ttag-2.0.tar.gz

Download URL django-ttag-2.0.tar.gz
Size 227.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b414d974946566bbd0ea4b604a60cb88d82fa18210a1279bfc245012d6b7efe8
BLAKE2b-256 checksum
How to use checksums
0da5a06aef9e9566c63d893fcaa12746e9a42421337f071d33d6f9b3fbde10b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
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