]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Added additional criterion to the ==, != comparators, used with
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 8 Jun 2013 17:23:15 +0000 (13:23 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 8 Jun 2013 17:23:15 +0000 (13:23 -0400)
commit20d1e9c3fa8ccc99207988e27d89e18b1870bc2c
tree8e1584a5048fbbd6931118785890e5043cc9d5a8
parentd5363fca5400f6c4969c2756fcfcdae6b9703091
Added additional criterion to the ==, != comparators, used with
scalar values, for comparisons to None to also take into account
the association record itself being non-present, in addition to the
existing test for the scalar endpoint on the association record
being NULL.  Previously, comparing ``Cls.scalar == None`` would return
records for which ``Cls.associated`` were present and
``Cls.associated.scalar`` is None, but not rows for which
``Cls.associated`` is non-present.  More significantly, the
inverse operation ``Cls.scalar != None`` *would* return ``Cls``
rows for which ``Cls.associated`` was non-present.

Additionally, added a special use case where you
can call ``Cls.scalar.has()`` with no arguments,
when ``Cls.scalar`` is a column-based value - this returns whether or
not ``Cls.associated`` has any rows present, regardless of whether
or not ``Cls.associated.scalar`` is NULL or not.
[ticket:2751]
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/ext/associationproxy.py
test/ext/test_associationproxy.py