]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Backed out changeset 8ef278ec7557a5b3446807e9bc16624630ffd034
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 23 Oct 2011 19:48:51 +0000 (15:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 23 Oct 2011 19:48:51 +0000 (15:48 -0400)
lib/sqlalchemy/schema.py
lib/sqlalchemy/types.py

index 7ab008a1071160db3aebae65e9a352a43d535172..3d00b31979cd4d5313ae84d5ce777980e112fa7e 100644 (file)
@@ -322,30 +322,27 @@ class Table(SchemaItem, expression.TableClause):
         # we do it after the table is in the singleton dictionary to support
         # circular foreign keys
         if autoload:
-            self._autoload(metadata, autoload_with, include_columns)
+            if autoload_with:
+                autoload_with.run_callable(
+                    autoload_with.dialect.reflecttable,
+                    self, include_columns
+                )
+            else:
+                bind = _bind_or_error(metadata, 
+                        msg="No engine is bound to this Table's MetaData. "
+                        "Pass an engine to the Table via "
+                        "autoload_with=<someengine>, "
+                        "or associate the MetaData with an engine via "
+                        "metadata.bind=<someengine>")
+                bind.run_callable(
+                        bind.dialect.reflecttable,
+                        self, include_columns
+                    )
 
         # initialize all the column, etc. objects.  done after reflection to
         # allow user-overrides
         self._init_items(*args)
 
-    def _autoload(self, metadata, autoload_with, include_columns):
-        if autoload_with:
-            autoload_with.run_callable(
-                autoload_with.dialect.reflecttable,
-                self, include_columns
-            )
-        else:
-            bind = _bind_or_error(metadata, 
-                    msg="No engine is bound to this Table's MetaData. "
-                    "Pass an engine to the Table via "
-                    "autoload_with=<someengine>, "
-                    "or associate the MetaData with an engine via "
-                    "metadata.bind=<someengine>")
-            bind.run_callable(
-                    bind.dialect.reflecttable,
-                    self, include_columns
-                )
-
     @property
     def _sorted_constraints(self):
         """Return the set of constraints as a list, sorted by creation order."""
@@ -374,9 +371,6 @@ class Table(SchemaItem, expression.TableClause):
         if 'info' in kwargs:
             self.info = kwargs.pop('info')
 
-        if autoload:
-            self._autoload(self.metadata, autoload_with, include_columns)
-
         self._extra_kwargs(**kwargs)
         self._init_items(*args)
 
index af98dd8139f951b8712de3dc9a80749300610011..e58313466aa7e8e02b1133c75364660775487164 100644 (file)
@@ -1584,7 +1584,7 @@ class _Binary(TypeEngine):
 
     @property
     def python_type(self):
-        # Py3K
+        #Py3K
         #return bytes
         # Py2K
         return str