]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
make ProxyImpl a top-level class (this makes it importable by FormAlchemy, making...
authorJonathan Ellis <jbellis@gmail.com>
Fri, 1 Aug 2008 23:02:02 +0000 (23:02 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Fri, 1 Aug 2008 23:02:02 +0000 (23:02 +0000)
lib/sqlalchemy/orm/attributes.py

index fa5fb69a3cd9d77c7336e0a1ca0ebecfaa8a4126..49a49e36e9aece7ce165841325db717080bd7919 100644 (file)
@@ -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):