From: Jonathan Ellis Date: Fri, 1 Aug 2008 23:02:02 +0000 (+0000) Subject: make ProxyImpl a top-level class (this makes it importable by FormAlchemy, making... X-Git-Tag: rel_0_5beta3~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72a4e6b2657b6e9dad55c2340c87e4b5318f85b0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git make ProxyImpl a top-level class (this makes it importable by FormAlchemy, making reverse-engineering synonyms a bit easier) --- diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index fa5fb69a3c..49a49e36e9 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -123,6 +123,12 @@ class InstrumentedAttribute(QueryableAttribute): return self return self.impl.get(instance_state(instance)) +class _ProxyImpl(object): + accepts_scalar_loader = False + + def __init__(self, key): + self.key = key + def proxied_attribute_factory(descriptor): """Create an InstrumentedAttribute / user descriptor hybrid. @@ -130,12 +136,6 @@ def proxied_attribute_factory(descriptor): behavior and getattr() to the given descriptor. """ - class ProxyImpl(object): - accepts_scalar_loader = False - - def __init__(self, key): - self.key = key - class Proxy(InstrumentedAttribute): """A combination of InsturmentedAttribute and a regular descriptor.""" @@ -145,7 +145,7 @@ def proxied_attribute_factory(descriptor): self.descriptor = self.user_prop = descriptor self._comparator = comparator self._parententity = parententity - self.impl = ProxyImpl(key) + self.impl = _ProxyImpl(key) def comparator(self): if callable(self._comparator):