Skip to main content

Allows easy creation of template tags that define a context variable

Project description

Allows easy creation of template tags that define a context variable


The "tag function" returns a value which, when called inside a template, is stored in a
variable or displayed directly.

Example:

@definition_tag(register=register)
def top_players(context):
return TopScores.objects.order_by('-elo')[:20]

Inside the template, we could call {% top_players %} to output the data, or we could call
{% top_players as foo %} {{ foo }}.

Project details


Download files

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

Files for django-definition-tag, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django-definition-tag-0.1.0.tar.gz (1.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page