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:
@ -225,18 +225,6 @@ def prepare_cloned_fields(instance):
|
|||||||
return param_string
|
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):
|
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
|
Return a new dictionary of the different keys. The values of `destination_dict` are returned. Only the equality of
|
||||||
|
@ -25,7 +25,7 @@ from extras.models import CustomField, CustomFieldValue, ExportTemplate
|
|||||||
from extras.querysets import CustomFieldQueryset
|
from extras.querysets import CustomFieldQueryset
|
||||||
from utilities.exceptions import AbortTransaction
|
from utilities.exceptions import AbortTransaction
|
||||||
from utilities.forms import BootstrapMixin, CSVDataField
|
from utilities.forms import BootstrapMixin, CSVDataField
|
||||||
from utilities.utils import csv_format, prepare_cloned_fields, querydict_to_dict
|
from utilities.utils import csv_format, prepare_cloned_fields
|
||||||
from .error_handlers import handle_protectederror
|
from .error_handlers import handle_protectederror
|
||||||
from .forms import ConfirmationForm, ImportForm
|
from .forms import ConfirmationForm, ImportForm
|
||||||
from .paginator import EnhancedPaginator
|
from .paginator import EnhancedPaginator
|
||||||
|
Reference in New Issue
Block a user