[portable dump] skip virtual relations, they have no table associated. Closes #2841199 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Apr 2013 14:45:13 +0200
branchstable
changeset 8910 7652c3d46ba3
parent 8909 f46b017db2d9
child 8913 409ea1ed9832
[portable dump] skip virtual relations, they have no table associated. Closes #2841199
server/sources/native.py
--- a/server/sources/native.py	Wed Apr 24 14:37:48 2013 +0200
+++ b/server/sources/native.py	Wed Apr 24 14:45:13 2013 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -1715,7 +1715,7 @@
         return self._source.get_connection()
 
     def backup(self, backupfile):
-        archive=zipfile.ZipFile(backupfile, 'w', allowZip64=True)
+        archive = zipfile.ZipFile(backupfile, 'w', allowZip64=True)
         self.cnx = self.get_connection()
         try:
             self.cursor = self.cnx.cursor()
@@ -1750,7 +1750,7 @@
             etype_tables.append('%s%s'%(prefix, etype))
         for rtype in self.schema.relations():
             rschema = self.schema.rschema(rtype)
-            if rschema.final or rschema.inlined:
+            if rschema.final or rschema.inlined or rschema in VIRTUAL_RTYPES:
                 continue
             relation_tables.append('%s_relation' % rtype)
         return non_entity_tables + etype_tables + relation_tables