some cleanup and optimization

This commit is contained in:
collerek
2020-12-03 09:15:19 +01:00
parent 4e10ff03e2
commit b838fa1edf
7 changed files with 106 additions and 72 deletions

View File

@ -20,10 +20,6 @@ from typing import (
from ormar.exceptions import ModelPersistenceError, RelationshipInstanceError
from ormar.queryset.utils import translate_list_to_dict, update
try:
import orjson as json
except ImportError: # pragma: nocover
import json # type: ignore
import ormar # noqa: I100
from ormar.fields import BaseField
@ -45,7 +41,7 @@ Field = TypeVar("Field", bound=BaseField)
class ModelTableProxy:
if TYPE_CHECKING: # pragma no cover
Meta: ModelMeta
_related_names: Set
_related_names: Optional[Set]
_related_names_hash: Union[str, bytes]
pk: Any
get_name: Callable