]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add notes that @comparator and @expression don't go together.
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2017 00:02:21 +0000 (20:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 Oct 2017 00:02:21 +0000 (20:02 -0400)
Change-Id: I3fb366f8b49454453e4b6dada565c24c5ccb975e

lib/sqlalchemy/ext/hybrid.py

index 141a645995537e9e87ed2e2e69941ca6b022cbec..243ef961d41a2231b9bf200236c52a3b73a17904 100644 (file)
@@ -384,6 +384,10 @@ behavior of each SQLAlchemy expression operator individually.  They
 are useful when creating custom types that have some highly
 idiosyncratic behavior on the SQL side.
 
+.. note::  The :meth:`.hybrid_property.comparator` decorator introduced
+   in this section **replaces** the use of the
+   :meth:`.hybrid_property.expression` decorator.  They cannot be used together.
+
 The example class below allows case-insensitive comparisons on the attribute
 named ``word_insensitive``::
 
@@ -972,6 +976,10 @@ class hybrid_property(interfaces.InspectionAttrInfo):
         The return value of the decorated method should be an instance of
         :class:`~.hybrid.Comparator`.
 
+        .. note::  The :meth:`.hybrid_property.comparator` decorator
+           **replaces** the use of the :meth:`.hybrid_property.expression`
+           decorator.  They cannot be used together.
+
         When a hybrid is invoked at the class level, the
         :class:`~.hybrid.Comparator` object given here is wrapped inside of a
         specialized :class:`.QueryableAttribute`, which is the same kind of