From 262f6b4d1941b1051fe0150a5f268f2c81e368db Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 24 May 2011 20:31:44 -0400 Subject: [PATCH] - document query_class on relationship - note public constructors for RelationshipProperty, ColumnProperty --- lib/sqlalchemy/orm/__init__.py | 7 +++++++ lib/sqlalchemy/orm/properties.py | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/sqlalchemy/orm/__init__.py b/lib/sqlalchemy/orm/__init__.py index 8a0312d5a9..03612ac47a 100644 --- a/lib/sqlalchemy/orm/__init__.py +++ b/lib/sqlalchemy/orm/__init__.py @@ -490,6 +490,13 @@ def relationship(argument, secondary=None, **kwargs): used for self-referential relationships, indicates the column or list of columns that form the "remote side" of the relationship. + :param query_class: + a :class:`.Query` subclass that will be used as the base of the + "appender query" returned by a "dynamic" relationship, that + is, a relationship that specifies ``lazy="dynamic"`` or was + otherwise constructed using the :func:`.orm.dynamic_loader` + function. + :param secondaryjoin: a ColumnElement (i.e. WHERE criterion) that will be used as the join of an association table to the child object. By default, this value is diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index cf059513f1..53fb5d85de 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -31,11 +31,17 @@ from descriptor_props import CompositeProperty, SynonymProperty, \ ComparableProperty,ConcreteInheritedProperty class ColumnProperty(StrategizedProperty): - """Describes an object attribute that corresponds to a table column.""" + """Describes an object attribute that corresponds to a table column. + + Public constructor is the :func:`.orm.column_property` function. + + """ def __init__(self, *columns, **kwargs): """Construct a ColumnProperty. + Note the public constructor is the :func:`.orm.column_property` function. + :param \*columns: The list of `columns` describes a single object property. If there are multiple tables joined together for the mapper, this list represents the equivalent @@ -168,6 +174,9 @@ log.class_logger(ColumnProperty) class RelationshipProperty(StrategizedProperty): """Describes an object property that holds a single item or list of items that correspond to a related database table. + + Public constructor is the :func:`.orm.relationship` function. + """ def __init__(self, argument, -- 2.39.5