templatetags: add model_name
This commit is contained in:
parent
070af46ef1
commit
a0be3c0fda
|
@ -181,3 +181,8 @@ def is_checkbox(field):
|
||||||
def is_select(field):
|
def is_select(field):
|
||||||
"""Return True if field is a select."""
|
"""Return True if field is a select."""
|
||||||
return isinstance(field.widget, forms.Select)
|
return isinstance(field.widget, forms.Select)
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def model_name(instance):
|
||||||
|
return instance.__class__.__name__
|
||||||
|
|
Loading…
Reference in New Issue
Block a user