summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2009-01-13 02:43:52 +0000
committerJason Kirtland <jek@discorporate.us>2009-01-13 02:43:52 +0000
commit313762e86f889c45e35a5c81cef67941c517321d (patch)
treeeae6b0d84547caadeecf05667dbf3b2e1a9a2d63 /lib
parent4ae6690bb93d8ffc9e9c2753e481a2d8d823bef7 (diff)
downloadsqlalchemy-313762e86f889c45e35a5c81cef67941c517321d.tar.gz
- Tightened up **kw on ColumnProperty and its front-end functions.
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/properties.py29
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index 0211b9707..a4561d443 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -32,12 +32,24 @@ class ColumnProperty(StrategizedProperty):
"""Describes an object attribute that corresponds to a table column."""
def __init__(self, *columns, **kwargs):
- """The list of `columns` describes a single object
- property. If there are multiple tables joined together for the
- mapper, this list represents the equivalent column as it
- appears across each table.
- """
+ """Construct a ColumnProperty.
+
+ :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
+ column as it appears across each table.
+
+ :param group:
+
+ :param deferred:
+
+ :param comparator_factory:
+ :param descriptor:
+
+ :param extension:
+
+ """
self.columns = [expression._labeled(c) for c in columns]
self.group = kwargs.pop('group', None)
self.deferred = kwargs.pop('deferred', False)
@@ -45,6 +57,11 @@ class ColumnProperty(StrategizedProperty):
self.comparator_factory = kwargs.pop('comparator_factory', self.__class__.Comparator)
self.descriptor = kwargs.pop('descriptor', None)
self.extension = kwargs.pop('extension', None)
+ if kwargs:
+ raise TypeError(
+ "%s received unexpected keyword argument(s): %s" % (
+ self.__class__.__name__, ', '.join(sorted(kwargs.keys()))))
+
util.set_creation_order(self)
if self.no_instrument:
self.strategy_class = strategies.UninstrumentedColumnLoader
@@ -1136,4 +1153,4 @@ mapper.ColumnProperty = ColumnProperty
mapper.SynonymProperty = SynonymProperty
mapper.ComparableProperty = ComparableProperty
mapper.RelationProperty = RelationProperty
-mapper.ConcreteInheritedProperty = ConcreteInheritedProperty \ No newline at end of file
+mapper.ConcreteInheritedProperty = ConcreteInheritedProperty