Skip to content

Commit 2c922aa

Browse files
add support for Django 5.2 (#188)
1 parent dc9684f commit 2c922aa

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
2121
### Added
2222

2323
- Support for the `django.templates.backends.jinja2.Jinja2` template engine backend.
24+
- Support for Django 5.2.
2425

2526
### New Contributors
2627

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
<!-- intro-start -->
44
[![PyPI](https://img.shields.io/pypi/v/django-simple-nav)](https://pypi.org/project/django-simple-nav/)
55
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-simple-nav)
6-
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.0%20%7C%205.1-%2344B78B?labelColor=%23092E20)
6+
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.0%20%7C%205.1%20%7C%20-%2344B78B?labelColor=%23092E20)
77
<!-- https://shields.io/badges -->
8-
<!-- django-4.2 | 5.0 | 5.1-#44B78B -->
8+
<!-- django-4.2 | 5.0 | 5.1 | 5.2-#44B78B -->
99
<!-- labelColor=%23092E20 -->
1010

1111
`django-simple-nav` is a Python/Django application designed to simplify the integration of navigation and menu bars in your Django projects. With a straightforward API and customizable options, you can easily add and manage navigational elements in your web applications. It is designed to be simple to start with, but flexible enough to handle complex navigation structures while maintaining that same simplicity.
1212

1313
## Requirements
1414

1515
- Python 3.9, 3.10, 3.11, 3.12, 3.13
16-
- Django 4.2, 5.0, 5.1
16+
- Django 4.2, 5.0, 5.1, 5.2
1717

1818
## Installation
1919

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
DJ42 = "4.2"
2222
DJ50 = "5.0"
2323
DJ51 = "5.1"
24-
DJ52 = "5.2a1"
24+
DJ52 = "5.2"
2525
DJMAIN = "main"
2626
DJMAIN_MIN_PY = PY312
27-
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJMAIN]
27+
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJ52, DJMAIN]
2828
DJ_LTS = [
2929
version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN
3030
]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ classifiers = [
1212
"Framework :: Django :: 4.2",
1313
"Framework :: Django :: 5.0",
1414
"Framework :: Django :: 5.1",
15+
"Framework :: Django :: 5.2",
1516
"License :: OSI Approved :: MIT License",
1617
"Operating System :: OS Independent",
1718
"Programming Language :: Python",

src/django_simple_nav/nav.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def render(self, request: HttpRequest, template_name: str | None = None) -> str:
3737
template = self.get_template(template_name)
3838
if isinstance(template, str):
3939
engine = get_template_engine()
40-
template = engine.from_string(template)
40+
template: EngineTemplate = engine.from_string(template) # type: ignore[no-redef]
4141
return template.render(context, request)
4242

4343
def get_context_data(self, request: HttpRequest) -> dict[str, object]:
@@ -53,8 +53,10 @@ def get_items(self, request: HttpRequest) -> list[NavGroup | NavItem]:
5353
msg = f"{self.__class__!r} must define 'items' or override 'get_items()'"
5454
raise ImproperlyConfigured(msg)
5555

56-
def get_template(self, template_name: str | None = None) -> EngineTemplate | str:
57-
return get_template(template_name=template_name or self.get_template_name())
56+
def get_template(self, template_name: str | None = None) -> EngineTemplate:
57+
template_name = template_name or self.get_template_name()
58+
template = get_template(template_name=template_name)
59+
return cast(EngineTemplate, template)
5860

5961
def get_template_name(self) -> str:
6062
if self.template_name is not None:

0 commit comments

Comments
 (0)