Skip to content

Commit

Permalink
Fixup db.models.fields.Field overloads for pyright 1.1.378 (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
minmax committed Aug 29, 2024
1 parent 84064af commit 15ef8d9
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 64 deletions.
6 changes: 4 additions & 2 deletions django-stubs/contrib/postgres/fields/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ class ArrayField(CheckFieldDefaultMixin, Generic[_V], Field[_V | Combinable, _V]
base_field: Field[Any, _V],
size: int | None = ...,
verbose_name: str | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[False] = ...,
null: Literal[False] = False,
db_index: bool = ...,
default: list[_V] | Callable[[], list[_V]] | None = ...,
editable: bool = ...,
Expand All @@ -51,12 +52,13 @@ class ArrayField(CheckFieldDefaultMixin, Generic[_V], Field[_V | Combinable, _V]
base_field: Field[Any, _V],
size: int | None = ...,
verbose_name: str | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[True] = ...,
null: Literal[True],
db_index: bool = ...,
default: list[_V] | Callable[[], list[_V]] | None = ...,
editable: bool = ...,
Expand Down
18 changes: 12 additions & 6 deletions django-stubs/contrib/postgres/fields/citext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ class CICharField(CIText, CharField[_C]):
def __init__(
self: CICharField[str],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[False] = ...,
null: Literal[False] = False,
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -45,12 +46,13 @@ class CICharField(CIText, CharField[_C]):
def __init__(
self: CICharField[str | None],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[True] = ...,
null: Literal[True],
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -74,12 +76,13 @@ class CIEmailField(CIText, EmailField[_C]):
def __init__(
self: CIEmailField[str],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[False] = ...,
null: Literal[False] = False,
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -99,12 +102,13 @@ class CIEmailField(CIText, EmailField[_C]):
def __init__(
self: CIEmailField[str | None],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[True] = ...,
null: Literal[True],
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -128,12 +132,13 @@ class CITextField(CIText, TextField[_C]):
def __init__(
self: CITextField[str],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[False] = ...,
null: Literal[False] = False,
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -153,12 +158,13 @@ class CITextField(CIText, TextField[_C]):
def __init__(
self: CITextField[str | None],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[True] = ...,
null: Literal[True],
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand Down
6 changes: 4 additions & 2 deletions django-stubs/contrib/postgres/fields/hstore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class HStoreField(Generic[_T], CheckFieldDefaultMixin, Field[Any, Any]):
def __init__(
self: HStoreField[dict[str, str | None]],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[False] = ...,
null: Literal[False] = False,
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand All @@ -44,12 +45,13 @@ class HStoreField(Generic[_T], CheckFieldDefaultMixin, Field[Any, Any]):
def __init__(
self: HStoreField[dict[str, str | None] | None],
verbose_name: str | bytes | None = ...,
*,
name: str | None = ...,
primary_key: bool = ...,
max_length: int | None = ...,
unique: bool = ...,
blank: bool = ...,
null: Literal[True] = ...,
null: Literal[True],
db_index: bool = ...,
default: Any = ...,
editable: bool = ...,
Expand Down
Loading

0 comments on commit 15ef8d9

Please sign in to comment.