clean code
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
from orm.models.fakepydantic import FakePydantic
|
||||
from orm.models.model import Model
|
||||
|
||||
__all__ = [
|
||||
"Model"
|
||||
]
|
||||
__all__ = ["FakePydantic", "Model"]
|
||||
|
||||
@ -1,19 +1,29 @@
|
||||
import inspect
|
||||
import json
|
||||
import uuid
|
||||
from typing import TYPE_CHECKING, Dict, TypeVar, Type, Any, Optional, Callable, Set, List
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Set,
|
||||
TYPE_CHECKING,
|
||||
Type,
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
import databases
|
||||
import pydantic
|
||||
import sqlalchemy
|
||||
from pydantic import BaseModel
|
||||
|
||||
import orm
|
||||
import orm # noqa I100
|
||||
from orm.fields import BaseField
|
||||
from orm.models.metaclass import ModelMetaclass
|
||||
from orm.relations import RelationshipManager
|
||||
|
||||
if TYPE_CHECKING: #pragma no cover
|
||||
if TYPE_CHECKING: # pragma no cover
|
||||
from orm.models.model import Model
|
||||
|
||||
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
import copy
|
||||
from typing import Dict, Tuple, Type, Optional, List, Any
|
||||
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Tuple, Type
|
||||
|
||||
import sqlalchemy
|
||||
from pydantic import BaseConfig, create_model
|
||||
from pydantic.fields import ModelField
|
||||
|
||||
from orm import ForeignKey, ModelDefinitionError
|
||||
from orm import ForeignKey, ModelDefinitionError # noqa I100
|
||||
from orm.fields import BaseField
|
||||
from orm.relations import RelationshipManager
|
||||
|
||||
if TYPE_CHECKING: # pragma no cover
|
||||
from orm import Model
|
||||
|
||||
relationship_manager = RelationshipManager()
|
||||
|
||||
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
from typing import List, Any
|
||||
from typing import Any, List
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
import orm.queryset.queryset
|
||||
from orm.models.fakepydantic import FakePydantic
|
||||
import orm.queryset # noqa I100
|
||||
from orm.models import FakePydantic # noqa I100
|
||||
|
||||
|
||||
class Model(FakePydantic):
|
||||
__abstract__ = True
|
||||
|
||||
objects = orm.queryset.queryset.QuerySet()
|
||||
objects = orm.queryset.QuerySet()
|
||||
|
||||
@classmethod
|
||||
def from_row(
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
from orm.queryset.queryset import QuerySet
|
||||
|
||||
__all__ = ["QuerySet"]
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
from typing import Type, List, Any, Tuple, Dict, Union, Optional, TYPE_CHECKING
|
||||
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Tuple, Type, Union
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy import text
|
||||
|
||||
import orm
|
||||
import orm # noqa I100
|
||||
from orm.exceptions import QueryDefinitionError
|
||||
|
||||
if TYPE_CHECKING: # pragma no cover
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
from typing import NamedTuple, Type, List, Tuple, TYPE_CHECKING
|
||||
from typing import List, NamedTuple, TYPE_CHECKING, Tuple, Type
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy import text
|
||||
|
||||
import orm
|
||||
import orm # noqa I100
|
||||
from orm import ForeignKey
|
||||
from orm.fields import BaseField
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
from typing import Type, List, Any, Union, Tuple, TYPE_CHECKING
|
||||
from typing import Any, List, TYPE_CHECKING, Tuple, Type, Union
|
||||
|
||||
import databases
|
||||
import sqlalchemy
|
||||
|
||||
import orm # noqa I100
|
||||
from orm import NoMatch, MultipleMatches
|
||||
from orm import MultipleMatches, NoMatch
|
||||
from orm.queryset.clause import QueryClause
|
||||
from orm.queryset.query import Query
|
||||
|
||||
|
||||
Reference in New Issue
Block a user