From c9d1b225fdb5290d93dd4145d17f6711c84d8dbb Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 29 Oct 2011 02:24:35 -0400 Subject: [PATCH] Improved the return_type function --- apps/common/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/common/utils.py b/apps/common/utils.py index 61973996ac..c60c0ac1e1 100644 --- a/apps/common/utils.py +++ b/apps/common/utils.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- + # -*- coding: utf-8 -*- import os import re import types @@ -288,11 +288,11 @@ def return_type(value): if isinstance(value, types.FunctionType): return value.__doc__ if value.__doc__ else _(u'function found') elif isinstance(value, types.ClassType): - return _(u'class found: %s') % unicode(value).split("'")[1].split('.')[-1] + return u'%s.%s' % (value.__class__.__module__, value.__class__.__name__) elif isinstance(value, types.TypeType): - return _(u'class found: %s') % unicode(value).split("'")[1].split('.')[-1] + return u'%s.%s' % (value.__module__, value.__name__) elif isinstance(value, types.DictType) or isinstance(value, types.DictionaryType): - return ','.join(list(value)) + return u', '.join(list(value)) else: return value