]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Tightened up **kw on ColumnProperty and its front-end functions.
authorJason Kirtland <jek@discorporate.us>
Tue, 13 Jan 2009 02:43:52 +0000 (02:43 +0000)
committerJason Kirtland <jek@discorporate.us>
Tue, 13 Jan 2009 02:43:52 +0000 (02:43 +0000)
CHANGES
lib/sqlalchemy/orm/properties.py

diff --git a/CHANGES b/CHANGES
index bee0df276d09b8234f9ba4b7803470a0e028d256..35c0032f27e3b0aa13006b80ad71b988ec744ce7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -37,6 +37,9 @@ CHANGES
       operation, greatly simplifying typical usage patterns
       within declarative. [ticket:1269]
 
+    - ColumnProperty (and front-end helpers such as ``deferred``) no
+      longer ignores unknown **keyword arguments.
+
 - schema
     - Index now accepts column-oriented InstrumentedAttributes
       (i.e. column-based mapped class attributes) as column
index 0211b9707ac69ba6f16b38133a1a8d76323be4aa..a4561d443df6300764f107c9cd3b5d31149252c6 100644 (file)
@@ -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