From 013b6ee5381de420b5220a9e25f605ca2fa7519b Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Fri, 21 Dec 2018 05:16:48 +0300 Subject: [PATCH] move django.contrib.postgres --- .../contrib/postgres/fields/__init__.pyi | 13 ++++++++++--- .../contrib/postgres/fields/array.pyi | 1 - .../contrib/postgres/fields/jsonb.pyi | 1 - .../contrib/postgres/fields/mixins.pyi | 2 +- django-stubs/contrib/postgres/operations.pyi | 19 +------------------ django-stubs/core/cache/backends/dummy.pyi | 2 +- 6 files changed, 13 insertions(+), 25 deletions(-) diff --git a/django-stubs/contrib/postgres/fields/__init__.pyi b/django-stubs/contrib/postgres/fields/__init__.pyi index c677ade..58d3fbc 100644 --- a/django-stubs/contrib/postgres/fields/__init__.pyi +++ b/django-stubs/contrib/postgres/fields/__init__.pyi @@ -1,3 +1,10 @@ -from .array import * # NOQA -from .jsonb import * # NOQA -from .ranges import * # NOQA +from .array import ArrayField as ArrayField +from .jsonb import JSONField as JSONField, JsonAdapter as JsonAdapter +from .ranges import ( + RangeField as RangeField, + IntegerRangeField as IntegerRangeField, + BigIntegerRangeField as BigIntegerRangeField, + FloatRangeField as FloatRangeField, + DateRangeField as DateRangeField, + DateTimeRangeField as DateTimeRangeField, +) diff --git a/django-stubs/contrib/postgres/fields/array.pyi b/django-stubs/contrib/postgres/fields/array.pyi index 1f55f9f..4871c5c 100644 --- a/django-stubs/contrib/postgres/fields/array.pyi +++ b/django-stubs/contrib/postgres/fields/array.pyi @@ -1,7 +1,6 @@ from typing import Any, Dict, List, Optional, Tuple, Union, TypeVar, Generic, Sequence from django.db.models.fields import Field - from .mixins import CheckFieldDefaultMixin _T = TypeVar("_T", bound=Field) diff --git a/django-stubs/contrib/postgres/fields/jsonb.pyi b/django-stubs/contrib/postgres/fields/jsonb.pyi index e39d0b1..6250c7f 100644 --- a/django-stubs/contrib/postgres/fields/jsonb.pyi +++ b/django-stubs/contrib/postgres/fields/jsonb.pyi @@ -2,7 +2,6 @@ from json import JSONEncoder from typing import Any, Dict, List, Optional, Tuple, Type, Union from django.db.models import Field - from .mixins import CheckFieldDefaultMixin class JsonAdapter(object): diff --git a/django-stubs/contrib/postgres/fields/mixins.pyi b/django-stubs/contrib/postgres/fields/mixins.pyi index 67a3629..c6e77c6 100644 --- a/django-stubs/contrib/postgres/fields/mixins.pyi +++ b/django-stubs/contrib/postgres/fields/mixins.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, Optional +from typing import Any, List class CheckFieldDefaultMixin: def check(self, **kwargs: Any) -> List[Any]: ... diff --git a/django-stubs/contrib/postgres/operations.pyi b/django-stubs/contrib/postgres/operations.pyi index 6fb7422..94fb10a 100644 --- a/django-stubs/contrib/postgres/operations.pyi +++ b/django-stubs/contrib/postgres/operations.pyi @@ -1,44 +1,27 @@ -from typing import Any, Optional - -from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.migrations.operations.base import Operation -from django.db.migrations.state import ProjectState class CreateExtension(Operation): reversible: bool = ... - name: Any = ... + name: str = ... def __init__(self, name: str) -> None: ... - def state_forwards(self, app_label: str, state: ProjectState) -> None: ... - def database_forwards( - self, app_label: str, schema_editor: DatabaseSchemaEditor, from_state: ProjectState, to_state: ProjectState - ) -> None: ... - def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ... - def describe(self): ... class BtreeGinExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class BtreeGistExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class CITextExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class CryptoExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class HStoreExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class TrigramExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... class UnaccentExtension(CreateExtension): - name: str = ... def __init__(self) -> None: ... diff --git a/django-stubs/core/cache/backends/dummy.pyi b/django-stubs/core/cache/backends/dummy.pyi index 78ec150..8cab85d 100644 --- a/django-stubs/core/cache/backends/dummy.pyi +++ b/django-stubs/core/cache/backends/dummy.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional, Union, Callable from django.core.cache.backends.base import BaseCache