Simplified admin.widgets.url_params_from_lookup_dict().
This commit is contained in:
parent
3633c2a045
commit
c309ec0824
|
@ -120,7 +120,6 @@ def url_params_from_lookup_dict(lookups):
|
||||||
"""
|
"""
|
||||||
params = {}
|
params = {}
|
||||||
if lookups and hasattr(lookups, 'items'):
|
if lookups and hasattr(lookups, 'items'):
|
||||||
items = []
|
|
||||||
for k, v in lookups.items():
|
for k, v in lookups.items():
|
||||||
if callable(v):
|
if callable(v):
|
||||||
v = v()
|
v = v()
|
||||||
|
@ -130,8 +129,7 @@ def url_params_from_lookup_dict(lookups):
|
||||||
v = ('0', '1')[v]
|
v = ('0', '1')[v]
|
||||||
else:
|
else:
|
||||||
v = str(v)
|
v = str(v)
|
||||||
items.append((k, v))
|
params[k] = v
|
||||||
params.update(dict(items))
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue