We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fc3c19 commit 21bdb0eCopy full SHA for 21bdb0e
ninja_extra/conf/package_settings.py
@@ -11,10 +11,14 @@
11
from ninja_extra.interfaces.ordering import OrderingBase
12
from ninja_extra.interfaces.route_context import RouteContextBase
13
from ninja_extra.interfaces.searching import SearchingBase
14
+from ninja_extra.lazy import LazyStrImport
15
16
_GenericModelValidator = AllowTypeOfSource(
- validator=lambda source, value: isinstance(value, type)
17
- and issubclass(value, source),
+ validator=lambda source, value: (
18
+ isinstance(value, LazyStrImport)
19
+ or isinstance(value, type)
20
+ and issubclass(value, source)
21
+ ),
22
error_message=lambda source,
23
value: f"Expected type of {source.__name__}, received: {type(value)}",
24
)
0 commit comments