Skip to content

Commit 5231781

Browse files
authored
Merge pull request #251 from eadwinCode/module_import_error
fix: Module import error
2 parents 1fc3c19 + be8733e commit 5231781

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ninja_extra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Django Ninja Extra - Class Based Utility and more for Django Ninja(Fast Django REST framework)"""
22

3-
__version__ = "0.22.5"
3+
__version__ = "0.22.6"
44

55
import django
66

ninja_extra/conf/package_settings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
from ninja_extra.interfaces.ordering import OrderingBase
1212
from ninja_extra.interfaces.route_context import RouteContextBase
1313
from ninja_extra.interfaces.searching import SearchingBase
14+
from ninja_extra.lazy import LazyStrImport
1415

1516
_GenericModelValidator = AllowTypeOfSource(
16-
validator=lambda source, value: isinstance(value, type)
17-
and issubclass(value, source),
17+
validator=lambda source, value: (
18+
isinstance(value, LazyStrImport)
19+
or isinstance(value, type)
20+
and issubclass(value, source)
21+
),
1822
error_message=lambda source,
1923
value: f"Expected type of {source.__name__}, received: {type(value)}",
2024
)

0 commit comments

Comments
 (0)