class documentation
class Library: (source)
A class for registering template tags and filters. Compiled filter and template tag functions are stored in the filters and tags attributes. The filter, simple_tag, and inclusion_tag methods provide a convenient way to register callables as tags.
Method | __init__ |
Undocumented |
Method | filter |
Register a callable as a template filter. Example: |
Method | filter |
Undocumented |
Method | inclusion |
Register a callable as an inclusion tag: |
Method | simple |
Register a callable as a compiled template tag. Example: |
Method | tag |
Undocumented |
Method | tag |
Undocumented |
Instance Variable | filters |
Undocumented |
Instance Variable | tags |
Undocumented |
Register a callable as a template filter. Example: @register.filter def lower(value): return value.lower()
Register a callable as an inclusion tag: @register.inclusion_tag('results.html') def show_results(poll): choices = poll.choice_set.all() return {'choices': choices}