comparison sat_website/templatetags/utils.py @ 27:eda4deefecd1

reorganisation of the menu using submenus
author souliane <souliane@mailoo.org>
date Wed, 21 Jan 2015 20:07:20 +0100
parents
children b45621706d83
comparison
equal deleted inserted replaced
26:3df49721008c 27:eda4deefecd1
1 from django import template
2 register = template.Library()
3
4 @register.filter
5 def is_tuple(value):
6 """Tell if this value is a tuple or not.
7
8 @param value (obj): any object
9 @return: True if value is a tuple
10 """
11 # XXX: we would like to have is_type with an argument instead, but it would
12 # rely on a strange comparison - isinstance(value, arg) doesn't work here
13 return type(value) == tuple
14