Skip to content

Util tags

hypha.core.templatetags.util_tags

register module-attribute

register = Library()

widget_type

widget_type(bound_field)
Source code in hypha/core/templatetags/util_tags.py
@register.filter(name="widget_type")
def widget_type(bound_field):
    return camelcase_to_underscore(bound_field.field.widget.__class__.__name__)

field_type

field_type(bound_field)
Source code in hypha/core/templatetags/util_tags.py
@register.filter(name="field_type")
def field_type(bound_field):
    return camelcase_to_underscore(bound_field.field.__class__.__name__)

verbose_name

verbose_name(instance)
Source code in hypha/core/templatetags/util_tags.py
@register.simple_tag
def verbose_name(instance):
    return instance.specific._meta.verbose_name.title()