]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow reuse of hybrid_property across subclasses
authorDiana Clarke <diana.joan.clarke@gmail.com>
Thu, 16 Mar 2017 20:05:18 +0000 (16:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Mar 2017 19:42:42 +0000 (15:42 -0400)
commitcaeb274e287f514a50524fc9fe4aeedcb3740147
tree0668af2a6bbe4dce44ee4ea1c611a5f6ed856b31
parentf881dae8179b94f72ab0dc85d8f62be8c9ce2fe0
Allow reuse of hybrid_property across subclasses

The :class:`sqlalchemy.ext.hybrid.hybrid_property` class now supports
calling mutators like ``@setter``, ``@expression`` etc. multiple times
across subclasses, and now provides a ``@getter`` mutator, so that
a particular hybrid can be repurposed across subclasses or other
classes.  This now matches the behavior of ``@property`` in standard
Python.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #3911
Fixes: #3912
Change-Id: Iff033d8ccaae20ded9289cbfa789c376759381f5
doc/build/changelog/changelog_12.rst
doc/build/changelog/migration_12.rst
lib/sqlalchemy/ext/hybrid.py
test/ext/test_hybrid.py