def url_params_from_lookup_dict(lookups):
    params = {}
    if lookups and hasattr(lookups, 'items'):
        items = []
        for k, v in lookups.items():
            if callable(v):
                v = v()
            if isinstance(v, (tuple, list)):
                v = ','.join(str(x) for x in v)
            elif isinstance(v, bool):
                # See django.db.fields.BooleanField.get_prep_lookup
                v = ('0', '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
dataset/ETHPy150Open django/django/django/contrib/admin/widgets.py/url_params_from_lookup_dict