Skip to content

Commit ab50438

Browse files
committed
[peewee] Update to 4.3.0
Closes: #16129
1 parent 1b11667 commit ab50438

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

stubs/peewee/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "4.2.6"
1+
version = "4.3.0"
22
upstream-repository = "https://github.com/coleifer/peewee"
33
# We're not providing stubs for all playhouse modules right now
44
# https://github.com/python/typeshed/pull/11731#issuecomment-2065729058

stubs/peewee/peewee.pyi

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ SCOPE_COLUMN: Final = 16
7474
CSQ_PARENTHESES_NEVER: Final = 0
7575
CSQ_PARENTHESES_ALWAYS: Final = 1
7676
CSQ_PARENTHESES_UNNESTED: Final = 2
77+
CSQ_PARENTHESES_GROUPED: Final = 3
78+
CSQ_FLAT: Final = 0
79+
CSQ_PARENS: Final = 1
80+
CSQ_WRAP: Final = 2
7781
SNAKE_CASE_STEP1: Final[re.Pattern[str]]
7882
SNAKE_CASE_STEP2: Final[re.Pattern[str]]
7983
IDENTIFIER_RE: Final[re.Pattern[str]]
@@ -946,7 +950,6 @@ class SqliteDatabase(Database):
946950
def unload_extension(self, extension) -> None: ...
947951
def attach(self, filename, name) -> bool: ...
948952
def detach(self, name) -> bool: ...
949-
def last_insert_id(self, cursor, query_type=None): ...
950953
def begin(self, lock_type=None) -> None: ...
951954
def get_tables(self, schema: str | None = None) -> list[str]: ...
952955
def get_views(self, schema: str | None = None) -> list[ViewMetadata]: ...
@@ -1027,7 +1030,6 @@ class PostgresqlDatabase(Database):
10271030
**kwargs,
10281031
) -> None: ...
10291032
def is_connection_usable(self) -> bool: ...
1030-
def last_insert_id(self, cursor, query_type=None): ...
10311033
def begin(self, isolation_level: str | None = None) -> None: ...
10321034
def get_tables(self, schema: str | None = None) -> list[str]: ...
10331035
def get_views(self, schema: str | None = None) -> list[ViewMetadata]: ...
@@ -1228,7 +1230,8 @@ class Field(ColumnBase, Generic[_V]):
12281230
def adapt(self, value): ...
12291231
def db_value(self, value): ...
12301232
def python_value(self, value): ...
1231-
def to_value(self, value, case: bool = False) -> Value: ...
1233+
def to_value(self, value) -> Value: ...
1234+
def case_value(self, value) -> Value: ...
12321235
def get_sort_key(self, ctx) -> tuple[Incomplete, ...]: ...
12331236
def __sql__(self, ctx): ...
12341237
def get_modifiers(self) -> list[int] | None: ...
@@ -1597,8 +1600,10 @@ class ForeignKeyField(Field[_V]):
15971600
cls, model: type[_M], *args: Any, null: Literal[False] = ..., **kwargs: Unpack[_FKKwargs]
15981601
) -> ForeignKeyField[_M]: ...
15991602
@overload
1600-
# Untyped fallback: model given as a name/"self"/deferred ref, so the related type isn't known.
1601-
def __new__(cls, model: Any = ..., *args: Any, **kwargs: Unpack[_FKKwargs]) -> ForeignKeyField[Any]: ...
1603+
# Self-reference, the only string peewee accepts. Named refs use DeferredForeignKey.
1604+
def __new__(
1605+
cls, model: Literal["self"] = ..., *args: Any, null: bool = ..., **kwargs: Unpack[_FKKwargs]
1606+
) -> ForeignKeyField[Any]: ...
16021607

16031608
@property
16041609
def field_type(self): ... # type: ignore[override]
@@ -1616,7 +1621,8 @@ class ForeignKeyField(Field[_V]):
16161621
class DeferredForeignKey(Field):
16171622
field_kwargs: Incomplete
16181623
rel_model_name: Incomplete
1619-
def __init__(self, rel_model_name, **kwargs) -> None: ...
1624+
# Model named by string, so the related type isn't knowable and null can't refine it.
1625+
def __init__(self, rel_model_name: str, *, null: bool = ..., **kwargs: Unpack[_FKKwargs]) -> None: ...
16201626
__hash__ = object.__hash__
16211627
def __deepcopy__(self, memo=None) -> DeferredForeignKey: ...
16221628
def set_model(self, rel_model) -> None: ...

0 commit comments

Comments
 (0)