Skip to main content

django-ttag

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

Metadata

Release files for django-ttag 3.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 3.0
File Size Uploaded
django-ttag-3.0.tar.gz 28.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-ttag 3.0
File Interpreter ABI Platform
django_ttag-3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 49.8 kB

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

Download URL django-ttag-3.0.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a3ae5ad7fd46c8d44007f7fb8e1ca4662dc26b158d80dbef25dbbb2df9f7b9a
BLAKE2b-256 checksum
How to use checksums
b6bf5636ee8d3d13f4a35477c79dc5718e92adde1d8cf64d953b5e65dba5ffc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_ttag-3.0-py2.py3-none-any.whl

Download URL django_ttag-3.0-py2.py3-none-any.whl
Size 21.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
37d5b8e1390ee387c573df5aeb8759e2f34b3cd5caf3f19c1bb6c8d25d567ec2
BLAKE2b-256 checksum
How to use checksums
ff6aff2a17a5ca76a9cbc69470745941acdf7291bf16bd817e08fa76bc89b6c0
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