]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
make anno-only Mapped[] column available for mixins
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jul 2022 16:25:22 +0000 (12:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jul 2022 16:37:06 +0000 (12:37 -0400)
commit0aa56cd729407dff1d96c61432b6f3a2a7124d39
tree4cda2e1335d2a942632428cb93810a05d4606f1c
parenta0597341195ba7445ef1e9c69092e3bd29427aec
make anno-only Mapped[] column available for mixins

Documentation is relying on the recently improved
behavior of produce_column_copies() to make sure everything is
available on cls for a declared_attr.  therefore for anno-only
attribute, we also need to generate the mapped_column() up front
before scan is called.

noticed in pylance, allow @declared_attr to recognize
@classmethod also which allows letting typing tools know
something is explicitly a classmethod

Change-Id: I07ff1a642a75679f685914a33c674807929f4918
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/decl_base.py
test/orm/declarative/test_mixin.py
test/orm/declarative/test_typed_mapping.py