Skip to content

Commit c4886c3

Browse files
authored
Merge branch 'master' into pyup-update-mypy-1.10.0-to-1.13.0
2 parents 5e0595b + 76cad7b commit c4886c3

15 files changed

Lines changed: 152 additions & 43 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
strategy:
1212
max-parallel: 6
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: "${{ matrix.python-version }}"
2222
- name: Install dependencies
@@ -37,9 +37,9 @@ jobs:
3737
runs-on: ubuntu-latest
3838

3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v2
42+
uses: actions/setup-python@v5
4343
with:
4444
python-version: 3.12
4545
- name: Install dependencies

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Changelog
2+
3+
## 0.95
4+
_Aug 27, 2025_
5+
6+
* Fix 500 errors when receiving malformed JSON (@avacaru on PR#381)
7+
8+
## 0.94.2
9+
_May 14, 2025_
10+
11+
* Added tests for Django 5.1 and Python 3.13.
12+
* Removed tests for Django 4.1, Python 3.8 and DRF 3.13
13+
* Added support for `use_regex_path=False` in DRF 3.15 (@Gibsondz on PR#355)
14+
15+
## 0.94.1
16+
_May 10, 2024_
17+
18+
* Removed support for Django 3.2 LTS.
19+
* Changed minimum requirements (Python 3.8, Django 4.2, DRF 3.14)
20+
* Add type hints
21+
22+
## 0.94.0
23+
_May 10, 2024_
24+
25+
* Add initial type hint support
26+
* Removed Python 2 compatibility
27+
* Changed CI from Travis to GitHub CI
28+
* Updated timezone database
29+
30+
## 0.93.5
31+
_Dec 19, 2023_
32+
33+
* Add Support for Django 4.x
34+
* Removed support for Python 3.6, Django 1.11 and DRF 3.6
35+
* Change minimum requirements (Python 3.7, Django 3.2, DRF 3.14.0)
36+
* Update timezone database
37+
* Add swagger support for NestedViewSetMixin
38+
39+
## 0.93.4
40+
_Oct 15, 2021_
41+
42+
* Add serializer examples
43+
* Fix KeyError exception for nested resource during generate swagger ( #228 )
44+
* Improved documentation
45+

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ exist without a domain, so you need it "nested" inside the domain.
1717

1818
## Requirements & Compatibility
1919

20-
- Python (3.8, 3.9, 3.10, 3.11, 3.12)
21-
- Django (4.2, 5.0)
20+
- Python (3.9, 3.10, 3.11, 3.12, 3.13)
21+
- Django (4.2, 5.0, 5.1)
2222
- Django REST Framework (3.14, 3.15)
2323

24-
It may work with lower versions, but since the release **0.93.5** is no more tested on CI for Python 3.6 or lower.<br/>
24+
It may work with lower versions, but since the release **0.94.2** is no more tested on CI for Python 3.8 or lower.<br/>
2525
And since **0.92.1** is no more tested on CI for Pythons 2.7 to 3.5, Django 1.11 to 2.1 or DRF 3.6 to 3.10.<br/>
2626
Before that, the release **0.90.2** was tested also with DRF 2.4.3 up to 3.7.
2727

requirements-tox.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Test requirements
22

3-
pytest==8.2.0
3+
pytest==8.3.4
44
pytest-cov==5.0.0
5-
pytest-django==4.8.0
6-
flake8==7.0.0
5+
pytest-django==4.9.0
6+
flake8==7.1.1
77
ipdb==0.13.13
88
pytz==2024.1
99

1010
# Type checking requirements
1111
mypy==1.13.0
12-
django-stubs==5.0.0
12+
django-stubs==5.1.1
1313
djangorestframework-stubs==3.15.0
1414

1515
# wheel for PyPI installs
16-
wheel==0.43.0
16+
wheel==0.45.1
1717

1818
# MkDocs for documentation previews/deploys
1919
mkdocs==1.5.2

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
# Minimum Django and REST framework version
55
Django>=4.2
6-
djangorestframework>=3.14.0
6+
djangorestframework>=3.15.0
77

rest_framework_nested/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '0.94.1'
15+
__version__ = '0.95.0'

rest_framework_nested/routers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(
5959
self.parent_prefix = parent_prefix
6060
self.nest_count = getattr(parent_router, 'nest_count', 0) + 1
6161
self.nest_prefix = kwargs.pop('lookup', f'nested_{self.nest_count}') + '_'
62+
self.use_regex_path = kwargs.get('use_regex_path', True)
6263

6364
super().__init__(*args, **kwargs)
6465

@@ -111,7 +112,11 @@ def __init__(
111112
# to escape it
112113
escaped_parent_regex = self.parent_regex.replace('{', '{{').replace('}', '}}')
113114

114-
route_contents['url'] = route.url.replace('^', '^' + escaped_parent_regex)
115+
if self.use_regex_path:
116+
route_contents['url'] = route.url.replace('^', '^' + escaped_parent_regex)
117+
else:
118+
route_contents['url'] = escaped_parent_regex + route_contents['url']
119+
115120
nested_routes.append(type(route)(**route_contents))
116121

117122
self.routes = nested_routes

rest_framework_nested/viewsets.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ def get_queryset(self) -> QuerySet[T_Model]:
6464
orm_filters[field_name] = self.kwargs[query_param] # type: ignore[attr-defined]
6565
return queryset.filter(**orm_filters)
6666

67-
def initialize_request(self, request: HttpRequest, *args: Any, **kwargs: Any) -> Request:
67+
def initial(self, request: Request, *args: Any, **kwargs: Any) -> None:
6868
"""
6969
Adds the parent params from URL inside the children data available
7070
"""
71-
drf_request: Request = super().initialize_request(request, *args, **kwargs) # type: ignore[misc]
71+
# run all the DRF API policies first
72+
super().initial(request, *args, **kwargs) # type: ignore[misc]
7273

7374
if getattr(self, 'swagger_fake_view', False):
74-
return drf_request
75+
return
7576

7677
for url_kwarg, fk_filter in self._get_parent_lookup_kwargs().items():
7778
# fk_filter is alike 'grandparent__parent__pk'
7879
parent_arg = fk_filter.partition('__')[0]
79-
for querydict in [drf_request.data, drf_request.query_params]:
80+
for querydict in [request.data, request.query_params]:
8081
with _force_mutable(querydict):
8182
querydict[parent_arg] = kwargs[url_kwarg]
82-
return drf_request

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.94.1
2+
current_version = 0.95.0
33
commit = True
44
tag = True
55

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_package_data(package):
7676
packages=get_packages(package),
7777
package_data=get_package_data(package),
7878
install_requires=[
79-
'djangorestframework>=3.14.0',
79+
'djangorestframework>=3.15.0',
8080
'Django>=4.2',
8181
],
8282
python_requires=">=3.8",
@@ -96,6 +96,7 @@ def get_package_data(package):
9696
'Programming Language :: Python :: 3.10',
9797
'Programming Language :: Python :: 3.11',
9898
'Programming Language :: Python :: 3.12',
99+
'Programming Language :: Python :: 3.13',
99100
'Topic :: Internet :: WWW/HTTP',
100101
]
101102
)

0 commit comments

Comments
 (0)