toolkit.templatetags – Toolkit template tags

Pagination tags

toolkit.templatetags.pagination.append_querystrings_as_hidden_fields(request)

Append querystrings to a form as hidden fields

Generates a Table heading with ordering paramaters based values passed
by AbstractedListMixin that allows users to order an object_list table in a ListView by a particular column(ASC and DESC)

Generates the pagination footer in a ListView template

toolkit.templatetags.pagination.url_replace(request, value)

Method used to the page querystring and return an update url

Bootstrap tags

toolkit.templatetags.bootstrap_tags.boolean_icon(value)
Parameters:value (Bool) – Nullable boolean value
Returns html:i tag with fontawesome icon representation
toolkit.templatetags.bootstrap_tags.render_detail(value, param)
Returns:appropriate html rendering of value

Templates helpers

class toolkit.templatetags.template_helpers.MakeListNode(items, varname)

Helper method for make_list

http://stackoverflow.com/questions/3715550/creating-a-list-on-the-fly-in-a-django-template

toolkit.templatetags.template_helpers.is_bootstrap_styled_field(formfield)
Template tag used in a django template to check if a form field can be
styled using bootstrap
Parameters:formfield (FormField) – Django form field
Returns bool:True if the widget of the form field is one of the following - widgets.TextInput - widgets.Textarea - widgets.NumberInput - widgets.EmailInput - widgets.Select - widgets.DateInput - widgets.PasswordInput - DynamicNullBooleanSelect - widgets.URLInput - widgets.NullBooleanSelect - widgets.SelectMultiple
toolkit.templatetags.template_helpers.is_date_field(formfield)
Template tag used in a django template to check if a form field is a
date field
Parameters:formfield (FormField) – Django form field
Returns bool:True if FormField is a date field
toolkit.templatetags.template_helpers.is_datetime_field(formfield)
Template tag used in a django template to check if a form field is a
datetime field
Parameters:formfield (FormField) – Django form field
Returns bool:True if FormField is a datetime field
toolkit.templatetags.template_helpers.is_time_field(formfield)
Template tag used in a django template to check if a form field is a
time field
Parameters:formfield (FormField) – Django form field
Returns bool:True if FormField is a time field
toolkit.templatetags.template_helpers.make_list(parser, token)

Template tag to create a python list within a Django template

Usage:
1
{% make_list var1 var2 var3 as some_list %}

http://stackoverflow.com/questions/3715550/creating-a-list-on-the-fly-in-a-django-template