Skip to content

Commit

Permalink
Small corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Dec 12, 2023
1 parent cbdd82e commit e2d416c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/coaster/sqlalchemy/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __init_subclass__(cls, *args: t.Any, **kwargs: t.Any) -> None:
# XXX: Is this the correct way to examine a generic subclass that may have
# more generic args in a redefined order? The docs suggest Generic args are
# assumed positional, but they may be reordered, so how do we determine the
# arg to IdMixin itself? There is no variant of `cls.mro()` that returns
# arg to IdMixin itself? There is no variant of `cls.__mro__` that returns
# original base classes with their generic args. For now, we expect that
# generic subclasses _must_ use the static `PkeyType` typevar in their
# definitions. This may need to be revisited with Python 3.12's new type
Expand Down
4 changes: 2 additions & 2 deletions src/coaster/sqlalchemy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class ModelWarning(UserWarning):

bigint: te.TypeAlias = te.Annotated[int, mapped_column(sa.BigInteger())]
smallint: te.TypeAlias = te.Annotated[int, mapped_column(sa.SmallInteger())]
int_pkey: te.TypeAlias = te.Annotated[int, mapped_column(primary_key=True, init=False)]
int_pkey: te.TypeAlias = te.Annotated[int, mapped_column(primary_key=True)]
uuid4_pkey: te.TypeAlias = te.Annotated[
uuid.UUID, mapped_column(primary_key=True, default=uuid.uuid4, init=False)
uuid.UUID, mapped_column(primary_key=True, default=uuid.uuid4)
]
timestamp: te.TypeAlias = te.Annotated[
datetime.datetime, mapped_column(sa.TIMESTAMP(timezone=True))
Expand Down
2 changes: 1 addition & 1 deletion src/coaster/views/classview.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def view(self):
model: t.Type[ModelType]
else:
#: The model that is being handled by this ModelView (autoset from Generic arg).
model: t.ClassVar[t.Type]
model: t.ClassVar[t.Type[ModelType]]

#: A loaded object of the model's type
obj: ModelType
Expand Down

0 comments on commit e2d416c

Please sign in to comment.