def prepare_lookup_value(key, value):
 if key.endswith(u'__in'):
  value = value.split(u',')
 if key.endswith(u'__isnull'):
  if (value.lower() in (u'', u'false', u'0')):
   value = False
  else:
   value = True
 return value

def prepare_lookup_value ( key , value ) : if key . endswith ( u'__in' ) : value = value . split ( u',' ) if key . endswith ( u'__isnull' ) : if ( value . lower ( ) in ( u'' , u'false' , u'0' ) ) : value = False else : value = True return value
returns a lookup value prepared to be used in queryset filtering .