def search_fields_to_dict(fields):
 if (not fields):
  return {}
 try:
  int(list(dict(fields).values())[0])
 except (TypeError, ValueError):
  fields = dict(zip(fields, ([1] * len(fields))))
 return fields

def search_fields_to_dict ( fields ) : if ( not fields ) : return { } try : int ( list ( dict ( fields ) . values ( ) ) [ 0 ] ) except ( TypeError , ValueError ) : fields = dict ( zip ( fields , ( [ 1 ] * len ( fields ) ) ) ) return fields
in searchablequeryset and searchablemanager .