AlekSIS
AlekSIS

Template tags

AlekSIS provides some templatetags to display data in templates.

Dashboard

aleksis.core.templatetags.dashboard.include_widget(context, widget)[source]

Render a template with context from a defined widget.

Return type

dict

Data helpers

aleksis.core.templatetags.data_helpers.build_badge(context, item)[source]

Get menu badge content from django-menu-generator dict.

Return type

Any

aleksis.core.templatetags.data_helpers.get_dict(value, arg)[source]

Get an attribute of an object dynamically from a string name.

Return type

Any

aleksis.core.templatetags.data_helpers.parse_json(value=None)[source]

Template tag for parsing JSON from a string.

Return type

Optional[dict]

aleksis.core.templatetags.data_helpers.verbose_name(app_label, model, field=None)[source]

Get a verbose name of a model or a field by app label and model name.

Return type

str

aleksis.core.templatetags.data_helpers.verbose_name_object(model, field=None)[source]

Get a verbose name of a model or a field by a model or an instance of a model.

Return type

str

HTML helpers

aleksis.core.templatetags.html_helpers.add_class_to_el(value, arg)[source]

Add a CSS class to every occurence of an element type.

Example

{{ mymodel.myhtmlfield|add_class_to_el:"ul,browser-default" }}
Return type

str