Skip to content

Commit

Permalink
attempt to make lint work on older python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nofalx committed Sep 13, 2023
1 parent 5f1b1a4 commit 68a7cbf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ninja/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def resolve_initials(self, obj):
"""
import warnings
from typing import Any, Callable, Dict, TypeVar, Union, no_type_check
from typing import Any, Callable, Dict, Type, TypeVar, Union, no_type_check

import pydantic
from django.db.models import Manager, QuerySet
Expand All @@ -46,7 +46,7 @@ def resolve_initials(self, obj):
class DjangoGetter:
__slots__ = ("_obj", "_schema_cls", "_context")

def __init__(self, obj: Any, schema_cls: type[S], context: Any = None):
def __init__(self, obj: Any, schema_cls: Type[S], context: Any = None):
self._obj = obj
self._schema_cls = schema_cls
self._context = context
Expand Down Expand Up @@ -218,12 +218,12 @@ def _run_root_validator(
return handler(values)

@classmethod
def from_orm(cls: type[S], obj: Any) -> S:
def from_orm(cls: Type[S], obj: Any) -> S:
return cls.model_validate(obj)

@classmethod
def model_validate(
cls: type[S],
cls: Type[S],
obj: Any,
*,
strict: bool | None = None,
Expand Down

0 comments on commit 68a7cbf

Please sign in to comment.