diff --git a/djangorestframework_camel_case/util.py b/djangorestframework_camel_case/util.py index 2f8ec07..fddc134 100644 --- a/djangorestframework_camel_case/util.py +++ b/djangorestframework_camel_case/util.py @@ -1,5 +1,6 @@ import re from collections import OrderedDict +from collections.abc import Iterable from django.core.files import File from django.http import QueryDict @@ -11,6 +12,11 @@ camelize_re = re.compile(r"[a-z0-9]?_[a-z0-9]") +underscoreize_re_map = { + True: re.compile(r"([a-z0-9]|[A-Z]?(?=[A-Z](?=[a-z])))([A-Z])"), + False: re.compile(r"([a-z0-9]|[A-Z]?(?=[A-Z0-9](?=[a-z0-9]|(?