]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix declarative
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 6 Aug 2010 22:54:52 +0000 (18:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 6 Aug 2010 22:54:52 +0000 (18:54 -0400)
lib/sqlalchemy/ext/declarative.py

index 2310f01ce3a4f12f4feaa55742f0e6b082b38771..dc7e5feb422900e2531e27d9c8d6181282bba8a8 100755 (executable)
@@ -1151,12 +1151,13 @@ class _GetColumns(object):
         
         mapper = class_mapper(self.cls, compile=False)
         if mapper:
-            prop = mapper.get_property(key, raiseerr=False)
-            if prop is None:
+            if not mapper.has_property(key):
                 raise exceptions.InvalidRequestError(
                             "Class %r does not have a mapped column named %r"
                             % (self.cls, key))
-            elif not isinstance(prop, ColumnProperty):
+                            
+            prop = mapper.get_property(key)
+            if not isinstance(prop, ColumnProperty):
                 raise exceptions.InvalidRequestError(
                             "Property %r is not an instance of"
                             " ColumnProperty (i.e. does not correspond"