From: Loic Baron Date: Fri, 4 Dec 2015 09:51:45 +0000 (+0100) Subject: Template filter used in cloud plugin X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=9090aa68d7f3cc8eebd460b9daa823c105f9a1bb Template filter used in cloud plugin --- diff --git a/portal/templatetags/portal_filters.py b/portal/templatetags/portal_filters.py index 74f113ad..7333efaf 100644 --- a/portal/templatetags/portal_filters.py +++ b/portal/templatetags/portal_filters.py @@ -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]