git://git.onelab.eu
/
unfold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe52134
)
Template filter used in cloud plugin
author
Loic Baron
<loic.baron@lip6.fr>
Fri, 4 Dec 2015 09:51:45 +0000
(10:51 +0100)
committer
Loic Baron
<loic.baron@lip6.fr>
Fri, 4 Dec 2015 09:51:45 +0000
(10:51 +0100)
portal/templatetags/portal_filters.py
patch
|
blob
|
history
diff --git
a/portal/templatetags/portal_filters.py
b/portal/templatetags/portal_filters.py
index
74f113a
..
7333efa
100644
(file)
--- 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]