from django.conf import settings
import base64
import django.core.urlresolvers
import lxml.etree
import urllib
import uuid
__BOOLEAN_DICT = {
'false':False,
'true':True,
'0':False,
'1':True,
't': True,
'f':False
}
def boolean_convert(bool):
if bool is None:
return False
if bool is True or bool is False:
return bool
key = str(bool).lower()
return __BOOLEAN_DICT.get(key, False)
def generate_uuid():
return unicode(uuid.uuid1())
def normalize_tags(list):
nlist=[]
for tag in list:
tag = tag.lower()
nlist.append(tag)
taglist = dict().fromkeys(nlist).keys()
return taglist