[Checkins] SVN: z3c.sqlalchemy/trunk/ Merged r103336 from branch 1.3

Vincent Fretin vincent.fretin at gmail.com
Fri Aug 28 10:27:57 EDT 2009


Log message for revision 103337:
  Merged r103336 from branch 1.3

Changed:
  U   z3c.sqlalchemy/trunk/CHANGES.txt
  U   z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/mapper.py

-=-
Modified: z3c.sqlalchemy/trunk/CHANGES.txt
===================================================================
--- z3c.sqlalchemy/trunk/CHANGES.txt	2009-08-28 14:27:07 UTC (rev 103336)
+++ z3c.sqlalchemy/trunk/CHANGES.txt	2009-08-28 14:27:56 UTC (rev 103337)
@@ -7,6 +7,12 @@
 1.3.11 (unreleased)
 -------------------
 
+- Don't create a new MetaData in LazyMapperCollection,
+  but use the one created in the wrapper.
+  In some cases, you could have some tables in the metadata created in the wrapper,
+  and some tables in the metadata created in the LazyMapperCollection,
+  which gave an error when trying to create relations.
+
 - When generating the mapper class, make sure table.name is a string.
   It can be unicode when use_unicode=1 with MySQL engine.
 

Modified: z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/mapper.py
===================================================================
--- z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/mapper.py	2009-08-28 14:27:07 UTC (rev 103336)
+++ z3c.sqlalchemy/trunk/src/z3c/sqlalchemy/mapper.py	2009-08-28 14:27:56 UTC (rev 103337)
@@ -14,7 +14,7 @@
 import new
 import threading
 
-from sqlalchemy import Table, MetaData 
+from sqlalchemy import Table 
 from sqlalchemy.orm import mapper, relation, class_mapper
 from sqlalchemy.ext.declarative import DeclarativeMeta
 
@@ -131,7 +131,7 @@
         self._wrapper = wrapper
         self._engine = wrapper.engine
         self._model = wrapper.model or {}
-        self._metadata = MetaData(self._engine)
+        self._metadata = wrapper.metadata
         self._mapper_factory = MapperFactory(self._metadata)
         self._dependent_tables = None
         self._lock = threading.Lock()



More information about the checkins mailing list