This commit is contained in:
Maxim Kurnikov
2019-07-24 22:56:14 +03:00
parent 64049b60b0
commit ae8e42dd53
3 changed files with 17 additions and 11 deletions

View File

@@ -1,20 +1,20 @@
import os
from collections import defaultdict
from contextlib import contextmanager
from typing import (Any, Dict, Iterator, List, Optional, TYPE_CHECKING, Tuple, Type)
from typing import TYPE_CHECKING, Dict, Iterator, List, Optional, Tuple, Type
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import FieldError
from django.db.models.base import Model
from django.db.models.fields import AutoField, CharField, Field
from django.db.models.fields.related import ForeignKey, RelatedField
from django.db.models.fields.reverse_related import ForeignObjectRel
from django.db.models.sql.query import Query
from django.utils.functional import cached_property
from mypy.checker import TypeChecker
from mypy.errors import Errors
from mypy.types import Instance, Type as MypyType
from mypy.types import Instance
from mypy.types import Type as MypyType
from django.contrib.postgres.fields import ArrayField
from django.db.models.fields import AutoField, CharField, Field
from mypy_django_plugin.lib import helpers
if TYPE_CHECKING:

View File

@@ -1,13 +1,17 @@
from collections import OrderedDict
from typing import Any, Dict, List, Optional, Set, TYPE_CHECKING, Union
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union
from mypy import checker
from mypy.checker import TypeChecker
from mypy.mro import calculate_mro
from mypy.nodes import (Block, ClassDef, Expression, GDEF, MDEF, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode,
SymbolTable, SymbolTableNode, TypeInfo, Var)
from mypy.nodes import (
GDEF, MDEF, Block, ClassDef, Expression, MemberExpr, MypyFile, NameExpr, StrExpr, SymbolNode, SymbolTable,
SymbolTableNode, TypeInfo, Var,
)
from mypy.plugin import CheckerPluginInterface, FunctionContext, MethodContext
from mypy.types import AnyType, Instance, NoneTyp, TupleType, Type as MypyType, TypeOfAny, TypedDictType, UnionType
from mypy.types import AnyType, Instance, NoneTyp, TupleType
from mypy.types import Type as MypyType
from mypy.types import TypedDictType, TypeOfAny, UnionType
if TYPE_CHECKING:
from mypy_django_plugin.django.context import DjangoContext

View File

@@ -1,11 +1,13 @@
from typing import Optional, Tuple, cast
from django.db.models.fields import Field
from django.db.models.fields.related import RelatedField
from mypy.nodes import AssignmentStmt, TypeInfo
from mypy.plugin import FunctionContext
from mypy.types import AnyType, Instance, Type as MypyType, TypeOfAny
from mypy.types import AnyType, Instance
from mypy.types import Type as MypyType
from mypy.types import TypeOfAny
from django.db.models.fields import Field
from mypy_django_plugin.django.context import DjangoContext
from mypy_django_plugin.lib import fullnames, helpers