Commit 4428d9038452f281ab87774142d72547aae7c6f8
1 parent
a2f47fb6
Exists in
dev
add new tag for django template to get the type of an object
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/core/pyros_django/dashboard/templatetags/tags.py
... | ... | @@ -99,4 +99,8 @@ def abs_filter(value): |
99 | 99 | |
100 | 100 | @register.filter(name="get_item") |
101 | 101 | def get_item(dictionnary,key): |
102 | - return dictionnary.get(key) | |
103 | 102 | \ No newline at end of file |
103 | + return dictionnary.get(key) | |
104 | + | |
105 | +@register.filter | |
106 | +def get_type(value): | |
107 | + return type(value).__name__ | |
104 | 108 | \ No newline at end of file | ... | ... |