From: Mike Bayer Date: Sat, 20 Nov 2010 17:55:46 +0000 (-0500) Subject: - merge hybrid attributes branch, [ticket:1903] X-Git-Tag: rel_0_7b1~252 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5442b3adb56cae15607aad32b4219ac11ae809e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - merge hybrid attributes branch, [ticket:1903] --- c5442b3adb56cae15607aad32b4219ac11ae809e diff --cc lib/sqlalchemy/orm/attributes.py index 6872dd645c,9c20b7eaf3..86f950813d --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@@ -1029,9 -1432,23 +1015,7 @@@ def has_parent(cls, obj, key, optimisti state = instance_state(obj) return manager.has_parent(state, key, optimistic) -def register_class(class_, **kw): - """Register class instrumentation. - - Returns the existing or newly created class manager. - """ - - manager = manager_of_class(class_) - if manager is None: - manager = _create_manager_for_cls(class_, **kw) - return manager - -def unregister_class(class_): - """Unregister class instrumentation.""" - - instrumentation_registry.unregister(class_) - def register_attribute(class_, key, **kw): - proxy_property = kw.pop('proxy_property', None) - comparator = kw.pop('comparator', None) parententity = kw.pop('parententity', None) doc = kw.pop('doc', None) @@@ -1078,11 -1491,7 +1061,7 @@@ def register_descriptor(class_, key, co parententity=None, property_=None, doc=None): manager = manager_of_class(class_) - if proxy_property: - proxy_type = proxied_attribute_factory(proxy_property) - descriptor = proxy_type(key, proxy_property, comparator, parententity) - else: - descriptor = InstrumentedAttribute(class_, key, comparator=comparator, - descriptor = InstrumentedAttribute(key, comparator=comparator, ++ descriptor = InstrumentedAttribute(class_, key, comparator=comparator, parententity=parententity) descriptor.__doc__ = doc