Statistics
| Branch: | Tag: | Revision:

root / snf-pithos-app / pithos / api / templatetags / get_type.py @ b2d77f0e

History | View | Annotate | Download (1.6 kB)

1 2e662088 Antony Chazapis
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2 690747fe Antony Chazapis
# 
3 690747fe Antony Chazapis
# Redistribution and use in source and binary forms, with or
4 690747fe Antony Chazapis
# without modification, are permitted provided that the following
5 690747fe Antony Chazapis
# conditions are met:
6 690747fe Antony Chazapis
# 
7 690747fe Antony Chazapis
#   1. Redistributions of source code must retain the above
8 690747fe Antony Chazapis
#      copyright notice, this list of conditions and the following
9 690747fe Antony Chazapis
#      disclaimer.
10 690747fe Antony Chazapis
# 
11 690747fe Antony Chazapis
#   2. Redistributions in binary form must reproduce the above
12 690747fe Antony Chazapis
#      copyright notice, this list of conditions and the following
13 690747fe Antony Chazapis
#      disclaimer in the documentation and/or other materials
14 690747fe Antony Chazapis
#      provided with the distribution.
15 690747fe Antony Chazapis
# 
16 690747fe Antony Chazapis
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 690747fe Antony Chazapis
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 690747fe Antony Chazapis
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 690747fe Antony Chazapis
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 690747fe Antony Chazapis
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 690747fe Antony Chazapis
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 690747fe Antony Chazapis
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 690747fe Antony Chazapis
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 690747fe Antony Chazapis
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 690747fe Antony Chazapis
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 690747fe Antony Chazapis
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 690747fe Antony Chazapis
# POSSIBILITY OF SUCH DAMAGE.
28 690747fe Antony Chazapis
# 
29 690747fe Antony Chazapis
# The views and conclusions contained in the software and
30 690747fe Antony Chazapis
# documentation are those of the authors and should not be
31 690747fe Antony Chazapis
# interpreted as representing official policies, either expressed
32 690747fe Antony Chazapis
# or implied, of GRNET S.A.
33 690747fe Antony Chazapis
34 690747fe Antony Chazapis
from django import template
35 690747fe Antony Chazapis
36 690747fe Antony Chazapis
register = template.Library()
37 690747fe Antony Chazapis
38 690747fe Antony Chazapis
@register.filter
39 690747fe Antony Chazapis
def get_type(value):  
40 690747fe Antony Chazapis
    return value.__class__.__name__