diff options
| author | Jonathan Ellis <jbellis@gmail.com> | 2008-08-01 23:02:02 +0000 |
|---|---|---|
| committer | Jonathan Ellis <jbellis@gmail.com> | 2008-08-01 23:02:02 +0000 |
| commit | 72a4e6b2657b6e9dad55c2340c87e4b5318f85b0 (patch) | |
| tree | 251f82e49fefddf38bcc3c1a2b0e30b603e21b8c | |
| parent | c7eeea8a959e075a78937cbc28ddb97cecc7ee30 (diff) | |
| download | sqlalchemy-72a4e6b2657b6e9dad55c2340c87e4b5318f85b0.tar.gz | |
make ProxyImpl a top-level class (this makes it importable by FormAlchemy, making reverse-engineering synonyms a bit easier)
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index fa5fb69a3..49a49e36e 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): |
