8.1.5.1.1. cobbler.web.templatetags package

8.1.5.1.1.1. Submodules

8.1.5.1.1.2. cobbler.web.templatetags.site module

class cobbler.web.templatetags.site.And(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.BaseCalc(var1, var2=None, negate=False)[source]

Bases: object

calculate(var1, var2)[source]
resolve(context)[source]
resolve_vars(context)[source]
class cobbler.web.templatetags.site.Equals(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.Greater(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.GreaterOrEqual(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.IfParser(tokens)[source]

Bases: object

at_end()[source]
create_var(value)[source]
error_class

alias of builtins.ValueError

get_token()[source]
get_var()[source]
parse()[source]
tokens
class cobbler.web.templatetags.site.In(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.Or(var1, var2=None, negate=False)[source]

Bases: cobbler.web.templatetags.site.BaseCalc

calculate(var1, var2)[source]
class cobbler.web.templatetags.site.SmartIfNode(var, nodelist_true, nodelist_false=None)[source]

Bases: django.template.base.Node

get_nodes_by_type(nodetype)[source]

Return a list of all nodes (within this node and its nodelist) of the given type

render(context)[source]

Return the node rendered as a string.

class cobbler.web.templatetags.site.SmartIfTests(methodName='runTest')[source]

Bases: unittest.case.TestCase

assertCalc(calc, context=None)[source]

Test a calculation is True, also checking the inverse “negate” case.

assertCalcFalse(calc, context=None)[source]

Test a calculation is False, also checking the inverse “negate” case.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_and()[source]
test_boolean()[source]
test_equals()[source]
test_greater()[source]
test_greater_or_equal()[source]
test_in()[source]
test_or()[source]
test_parse_bits()[source]
class cobbler.web.templatetags.site.TemplateIfParser(parser, *args, **kwargs)[source]

Bases: cobbler.web.templatetags.site.IfParser

create_var(value)[source]
error_class

alias of django.template.exceptions.TemplateSyntaxError

class cobbler.web.templatetags.site.TestVar(value)[source]

Bases: object

A basic self-resolvable object similar to a Django template variable. Used to assist with tests.

resolve(context)[source]
cobbler.web.templatetags.site.ifinlist(parser, token)

A smarter {% if %} tag for django templates.

While retaining current Django functionality, it also handles equality, greater than and less than operators. Some common case examples:

{% if articles|length >= 5 %}...{% endif %}
{% if "ifnotequal tag" != "beautiful" %}...{% endif %}

Arguments and operators _must_ have a space between them, so {% if 1>2 %} is not a valid smart if tag.

All supported operators are: or, and, in, = (or ==), !=, >, >=, < and <=.

cobbler.web.templatetags.site.listsort(value)[source]
cobbler.web.templatetags.site.register = <django.template.library.Library object>

A smarter {% if %} tag for django templates.

While retaining current Django functionality, it also handles equality, greater than and less than operators. Some common case examples:

{% if articles|length >= 5 %}...{% endif %}
{% if "ifnotequal tag" != "beautiful" %}...{% endif %}
cobbler.web.templatetags.site.smart_if(parser, token)[source]

A smarter {% if %} tag for django templates.

While retaining current Django functionality, it also handles equality, greater than and less than operators. Some common case examples:

{% if articles|length >= 5 %}...{% endif %}
{% if "ifnotequal tag" != "beautiful" %}...{% endif %}

Arguments and operators _must_ have a space between them, so {% if 1>2 %} is not a valid smart if tag.

All supported operators are: or, and, in, = (or ==), !=, >, >=, < and <=.

8.1.5.1.1.3. Module contents