Template filter used in cloud plugin
authorLoic Baron <loic.baron@lip6.fr>
Fri, 4 Dec 2015 09:51:45 +0000 (10:51 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 4 Dec 2015 09:51:45 +0000 (10:51 +0100)
portal/templatetags/portal_filters.py

index 74f113a..7333efa 100644 (file)
@@ -47,4 +47,12 @@ def file_exists(filepath):
     else:
         index = filepath.rfind('/')
         new_filepath = filepath[:index] + '/image.png'
-        return new_filepath
\ No newline at end of file
+        return new_filepath
+
+@register.filter
+def get_type(value):
+    return type(value).__name__
+
+@register.filter
+def get_name_from_urn(value):
+    return value.split("+")[-1]