def url_params_from_lookup_dict(lookups):
 params = {}
 if (lookups and hasattr(lookups, u'items')):
  items = []
  for (k, v) in lookups.items():
   if callable(v):
    v = v()
   if isinstance(v, (tuple, list)):
    v = u','.join([str(x) for x in v])
   elif isinstance(v, bool):
    v = (u'0', u'1')[v]
   else:
    v = six.text_type(v)
   items.append((k, v))
  params.update(dict(items))
 return params

def url_params_from_lookup_dict ( lookups ) : params = { } if ( lookups and hasattr ( lookups , u'items' ) ) : items = [ ] for ( k , v ) in lookups . items ( ) : if callable ( v ) : v = v ( ) if isinstance ( v , ( tuple , list ) ) : v = u',' . join ( [ str ( x ) for x in v ] ) elif isinstance ( v , bool ) : v = ( u'0' , u'1' ) [ v ] else : v = six . text_type ( v ) items . append ( ( k , v ) ) params . update ( dict ( items ) ) return params
converts the type of lookups specified in a foreignkey limit_choices_to attribute to a dictionary of query parameters .