1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Remove obsolete querydict_to_dict() utility function

This commit is contained in:
Jeremy Stretch
2020-02-28 15:47:59 -05:00
parent 1449dfc966
commit e285d0b547
2 changed files with 1 additions and 13 deletions

View File

@ -225,18 +225,6 @@ def prepare_cloned_fields(instance):
return param_string
def querydict_to_dict(querydict):
"""
Convert a django.http.QueryDict object to a regular Python dictionary, preserving lists of multiple values.
(QueryDict.dict() will return only the last value in a list for each key.)
"""
assert isinstance(querydict, QueryDict)
return {
key: querydict.get(key) if len(value) == 1 and key != 'pk' else querydict.getlist(key)
for key, value in querydict.lists()
}
def shallow_compare_dict(source_dict, destination_dict, exclude=None):
"""
Return a new dictionary of the different keys. The values of `destination_dict` are returned. Only the equality of