happen if there's really an UPDATE to occur.
[ticket:2390]
+ - [bug] Fixed bug whereby if a method name
+ conflicted with a column name, a
+ TypeError would be raised when the mapper
+ tried to inspect the __get__() method
+ on the method object. [ticket:2352]
+
- sql
- [bug] Added support for using the .key
of a Column as a string identifier in a
return result
def _is_userland_descriptor(self, obj):
- return not isinstance(obj,
- (MapperProperty, attributes.QueryableAttribute)) and \
- hasattr(obj, '__get__') and not \
- isinstance(obj.__get__(None, obj),
- attributes.QueryableAttribute)
-
+ if isinstance(obj, (MapperProperty,
+ attributes.QueryableAttribute)):
+ return False
+ elif not hasattr(obj, '__get__'):
+ return False
+ else:
+ obj = util.unbound_method_to_callable(obj)
+ if isinstance(
+ obj.__get__(None, obj),
+ attributes.QueryableAttribute
+ ):
+ return False
+ return True
def _should_exclude(self, name, assigned_name, local, column):
"""determine whether a particular property should be implicitly
mapper(Foo, addresses, inherits=User)
assert getattr(Foo().__class__, 'name').impl is not None
+ def test_check_descriptor_as_method(self):
+ User, users = self.classes.User, self.tables.users
+
+ m = mapper(User, users)
+ class MyClass(User):
+ def foo(self):
+ pass
+ m._is_userland_descriptor(MyClass.foo)
def test_configure_on_get_props_1(self):
User, users = self.classes.User, self.tables.users