class documentation
class Variable: (source)
A template variable, resolvable against a given context. The variable may be a hard-coded string (if it begins and ends with single or double quote marks):: >>> c = {'article': {'section':'News'}} >>> Variable('article.section').resolve(c) 'News' >>> Variable('article').resolve(c) {'section': 'News'} >>> class AClass: pass >>> c = AClass() >>> c.article = AClass() >>> c.article.section = 'News' (The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | resolve |
Resolve this variable against a given context. |
Class Variable | __slots__ |
Undocumented |
Instance Variable | literal |
Undocumented |
Instance Variable | lookups |
Undocumented |
Instance Variable | message |
Undocumented |
Instance Variable | translate |
Undocumented |
Instance Variable | var |
Undocumented |
Method | _resolve |
Perform resolution of a real variable (i.e. not a literal) against the given context. |