class documentation

class Library: (source)

View In Hierarchy

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_function Undocumented
Method inclusion_tag Register a callable as an inclusion tag:
Method simple_tag Register a callable as a compiled template tag. Example:
Method tag Undocumented
Method tag_function Undocumented
Instance Variable filters Undocumented
Instance Variable tags Undocumented
def __init__(self): (source)

Undocumented

def filter(self, name=None, filter_func=None, **flags): (source)

Register a callable as a template filter. Example: @register.filter def lower(value): return value.lower()

def filter_function(self, func, **flags): (source)

Undocumented

def inclusion_tag(self, filename, func=None, takes_context=None, name=None): (source)

Register a callable as an inclusion tag: @register.inclusion_tag('results.html') def show_results(poll): choices = poll.choice_set.all() return {'choices': choices}

def simple_tag(self, func=None, takes_context=None, name=None): (source)

Register a callable as a compiled template tag. Example: @register.simple_tag def hello(*args, **kwargs): return 'world'

def tag(self, name=None, compile_function=None): (source)

Undocumented

def tag_function(self, func): (source)

Undocumented

Undocumented

Undocumented