Skip to main content

django-meio-easytags

An easy way to create custom template tags for Django’s templating system.

Usage

Just instantiate EasyLibrary and register the renderer method as a template tag:

from easytags import EasyLibrary

register = EasyLibrary()

def sum(context, arg1, arg2, arg3=0):
    return int(arg1) + int(arg2) + int(arg3)

register.easytag(sum)

The EasyLibrary will take care of subclassing EasyNode that will take care of the template tag’s parsing, resolving variable and inspecting if the args are ok with the renderer signature. In the example above, you can use the sum tag in any of the forms below:

{% sum "1" "2" %}
{% sum "1" arg2="2" %}
{% sum arg1="1" arg2="2" %}
{% sum arg2="2" arg1="1" %}

It’s almost like calling methods in Python.

In this example, arg3 is optional and defaults to 0. So you may use or not this arg.

Metadata

Release files for django-meio-easytags 0.7

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-meio-easytags 0.7
File Size Uploaded Provenance Actions
django-meio-easytags-0.7.tar.gz 6.5 kB Without provenance Details for django-meio-easytags-0.7.tar.gz

Release files / django-meio-easytags-0.7.tar.gz

Download URL django-meio-easytags-0.7.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a130837eeaebb56355920b9708357c9b5a72f8e73855e830ac9e8dc0f7cf763f
BLAKE2b-256 checksum
How to use checksums
6b544c8c8dcc2f4b7650d3a5e8704867406d38bdca833d1e7e061c375f3abdd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-meio-easytags 0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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