A library to make Django's template tags sweet.
Project description
A library to make writing templatetags in Django sweet.
Here’s an example of using:
@tag(register, [Constant("for"), Variable(), Optional([Constant("as"), Name()])]): def example_tag(context, val, asvar=None): if asvar: context[asvar] = val return "" else: return val
As you can see it makes it super simple to define the syntax for a tag.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-templatetag-sugar-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d41277be9ed9356838969e3f90ef5cf80a197e64f298e93b3bf62f380cc96e4a |
|
MD5 | f5b8bf6e4cb82f8affa761574bf3dae4 |
|
BLAKE2b-256 | c07909b83a88e6b0ef00ef5472179da2680fd2f3d52d2a84327916fe11629c7a |