Package django :: Package template :: Class FilterExpression
[hide private]
[frames] | no frames]

Class FilterExpression

source code

object --+
         |
        FilterExpression

Parses a variable token and its optional filters (all as a single string), and return a list of tuples of the filter name and arguments. Sample:

>>> token = 'variable|default:"Default value"|date:"Y-m-d"'
>>> p = Parser('')
>>> fe = FilterExpression(token, p)
>>> len(fe.filters)
2
>>> fe.var
'variable'

This class should never be instantiated outside of the get_filters_from_token helper function.

Instance Methods [hide private]
 
__init__(self, token, parser)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
resolve(self, context, ignore_failures=False) source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Static Methods [hide private]
 
args_check(name, func, provided) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, token, parser)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)