From 4428d9038452f281ab87774142d72547aae7c6f8 Mon Sep 17 00:00:00 2001 From: Alexis Koralewski Date: Thu, 15 Jul 2021 18:17:28 +0200 Subject: [PATCH] add new tag for django template to get the type of an object --- src/core/pyros_django/dashboard/templatetags/tags.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/pyros_django/dashboard/templatetags/tags.py b/src/core/pyros_django/dashboard/templatetags/tags.py index 317be07..d108573 100644 --- a/src/core/pyros_django/dashboard/templatetags/tags.py +++ b/src/core/pyros_django/dashboard/templatetags/tags.py @@ -99,4 +99,8 @@ def abs_filter(value): @register.filter(name="get_item") def get_item(dictionnary,key): - return dictionnary.get(key) \ No newline at end of file + return dictionnary.get(key) + +@register.filter +def get_type(value): + return type(value).__name__ \ No newline at end of file -- libgit2 0.21.2