Skip to content

Commit d463129

Browse files
committed
Bug fixed
1 parent f6850b5 commit d463129

5 files changed

Lines changed: 31 additions & 8 deletions

File tree

drf_nested_forms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'drf_nested_formdata'
2-
__version__ = '1.1.6'
2+
__version__ = '1.1.7'
33
__author__ = 'Duke Effiom'
44
__license__ = 'MIT'
55
__copyright__ = 'Copyright 2021'

drf_nested_forms/mixins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --------------------------------------------
55

66
class UtilityMixin:
7-
_nested_re = re.compile(r'((.+)(\[(.*)\])+)|(\[(.*)\]){2,}')
7+
_nested_re = re.compile(r'((.+)(\[(.*)\])+)|(\[(.*)\]){1,}')
88
_namespace_re = re.compile(r'^([\w]+)(?=\[)')
99
_list_re = re.compile(r'\[[0-9]+\]')
1010
_number_re = re.compile(r'[0-9]+')
@@ -56,7 +56,7 @@ def strip_namespace(self, string=''):
5656
namespace = self._namespace_re.match(string)
5757

5858
if namespace:
59-
splited_string = string.split(namespace.group(0))
59+
splited_string = string.split(namespace.group(0), 1)
6060
return ''.join(splited_string)
6161

6262
return string

requirements.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
asgiref==3.3.4
22
autopep8==1.5.7
3-
Django==3.2.4
3+
bleach==3.3.0
4+
certifi==2021.5.30
5+
chardet==4.0.0
6+
colorama==0.4.4
7+
Django==3.2.9
48
djangorestframework==3.12.4
9+
docutils==0.17.1
10+
idna==2.10
11+
importlib-metadata==4.5.0
12+
keyring==23.0.1
13+
packaging==20.9
14+
pkginfo==1.7.0
515
pycodestyle==2.7.0
16+
Pygments==2.9.0
17+
pyparsing==2.4.7
618
pytz==2021.1
7-
sqlparse==0.4.1
19+
pywin32-ctypes==0.2.0
20+
readme-renderer==29.0
21+
requests==2.25.1
22+
requests-toolbelt==0.9.1
23+
rfc3986==1.5.0
24+
six==1.16.0
25+
sqlparse==0.4.2
826
toml==0.10.2
27+
tqdm==4.61.0
28+
twine==3.4.1
929
upgrade-requirements==1.7.0
30+
urllib3==1.26.5
31+
webencodings==0.5.1
32+
zipp==3.4.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_version(package):
2626
name='drf_nested_forms',
2727
version=version,
2828
url='http://github.com/emperorDuke/nested_formdata',
29-
download_url='http://github.com/emperorDuke/nested_formdata/archive/v1.1.6.tar.gz',
29+
download_url='http://github.com/emperorDuke/nested_formdata/archive/v1.1.7.tar.gz',
3030
license='MIT',
3131
description='A library that parses nested json or form data to python object',
3232
long_description=long_description,

tests/test_nested_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ def test_data_3(self):
7575
data_3 = {
7676
'vendor_metric': 'L',
7777
'attribute': 'size',
78-
'[variant][]': 'color',
78+
'product[variant]': 'color',
7979
}
8080

8181
expected_output = {
8282
'vendor_metric': 'L',
8383
'attribute': 'size',
84-
'variant': ['color']
84+
'product': {'variant': 'color'}
8585
}
8686

8787
form = NestedForm(data_3)

0 commit comments

Comments
 (0)