summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-08-06 12:43:09 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-08-06 12:43:09 -0400
commit669d0c47f8806173261a365b66cae6edf73287cb (patch)
treea1b5e21ba97f3ca09d76d97ea55586343da2d537 /lib/sqlalchemy/orm/interfaces.py
parent4fe4590a453569cabc9e791816f053860a1aee2b (diff)
downloadsqlalchemy-669d0c47f8806173261a365b66cae6edf73287cb.tar.gz
- second pass through association proxy docs, some more links on any()/has(), MapperProperty
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
-rw-r--r--lib/sqlalchemy/orm/interfaces.py40
1 files changed, 26 insertions, 14 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py
index 4f8e6dbfd..24aebcc7b 100644
--- a/lib/sqlalchemy/orm/interfaces.py
+++ b/lib/sqlalchemy/orm/interfaces.py
@@ -61,6 +61,13 @@ class MapperProperty(object):
attribute, as well as that attribute as it appears on individual
instances of the class, including attribute instrumentation,
attribute access, loading behavior, and dependency calculations.
+
+ The most common occurrences of :class:`.MapperProperty` are the
+ mapped :class:`.Column`, which is represented in a mapping as
+ an instance of :class:`.ColumnProperty`,
+ and a reference to another class produced by :func:`.relationship`,
+ represented in the mapping as an instance of :class:`.RelationshipProperty`.
+
"""
cascade = ()
@@ -244,8 +251,7 @@ class PropComparator(operators.ColumnOperators):
query.join(Company.employees.of_type(Engineer)).\\
filter(Engineer.name=='foo')
- \class_
- a class or mapper indicating that criterion will be against
+ :param \class_: a class or mapper indicating that criterion will be against
this specific subclass.
@@ -257,13 +263,16 @@ class PropComparator(operators.ColumnOperators):
"""Return true if this collection contains any member that meets the
given criterion.
- criterion
- an optional ClauseElement formulated against the member class' table
- or attributes.
+ The usual implementation of ``any()`` is
+ :meth:`.RelationshipProperty.Comparator.any`.
+
+ :param criterion: an optional ClauseElement formulated against the
+ member class' table or attributes.
+
+ :param \**kwargs: key/value pairs corresponding to member class attribute
+ names which will be compared via equality to the corresponding
+ values.
- \**kwargs
- key/value pairs corresponding to member class attribute names which
- will be compared via equality to the corresponding values.
"""
return self.operate(PropComparator.any_op, criterion, **kwargs)
@@ -272,13 +281,16 @@ class PropComparator(operators.ColumnOperators):
"""Return true if this element references a member which meets the
given criterion.
- criterion
- an optional ClauseElement formulated against the member class' table
- or attributes.
+ The usual implementation of ``has()`` is
+ :meth:`.RelationshipProperty.Comparator.has`.
+
+ :param criterion: an optional ClauseElement formulated against the
+ member class' table or attributes.
+
+ :param \**kwargs: key/value pairs corresponding to member class attribute
+ names which will be compared via equality to the corresponding
+ values.
- \**kwargs
- key/value pairs corresponding to member class attribute names which
- will be compared via equality to the corresponding values.
"""
return self.operate(PropComparator.has_op, criterion, **kwargs)