summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-10-03 17:06:55 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-10-03 17:06:55 -0400
commita83378b64005971fe97dff270641bce4967dbb53 (patch)
treebbfe8fbf510ddde2c71ff4e26cfe893ca9abce92 /lib/sqlalchemy/orm/interfaces.py
parent78c5249bf7d39c3aaa4954c7815a1ef48f2776db (diff)
downloadsqlalchemy-a83378b64005971fe97dff270641bce4967dbb53.tar.gz
- A new construct :class:`.Bundle` is added, which allows for specification
of groups of column expressions to a :class:`.Query` construct. The group of columns are returned as a single tuple by default. The behavior of :class:`.Bundle` can be overridden however to provide any sort of result processing to the returned row. One example included is :attr:`.Composite.Comparator.bundle`, which applies a bundled form of a "composite" mapped attribute. [ticket:2824] - The :func:`.composite` construct now maintains the return object when used in a column-oriented :class:`.Query`, rather than expanding out into individual columns. This makes use of the new :class:`.Bundle` feature internally. This behavior is backwards incompatible; to select from a composite column which will expand out, use ``MyClass.some_composite.clauses``.
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
-rw-r--r--lib/sqlalchemy/orm/interfaces.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py
index 4a1a1823d..2f4aa5208 100644
--- a/lib/sqlalchemy/orm/interfaces.py
+++ b/lib/sqlalchemy/orm/interfaces.py
@@ -320,6 +320,9 @@ class PropComparator(operators.ColumnOperators):
def __clause_element__(self):
raise NotImplementedError("%r" % self)
+ def _query_clause_element(self):
+ return self.__clause_element__()
+
def adapt_to_entity(self, adapt_to_entity):
"""Return a copy of this PropComparator which will use the given
:class:`.AliasedInsp` to produce corresponding expressions.