[dataimport, migration] more fixes in the spirit of a6c32edabc8d:

[entity, metadata] huuum, use resolvable url as cwuri... And fix existing ones.

authorDimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
changeset13051523ef6b
branchdefault
phasedraft
hiddenyes
parent revision#c88982c8a936 [rql2sql] remove special behaviour of symmetric relation vs DISTINCT
child revision<not specified>
files modified by this revision
dataimport.py
misc/migration/bootstrapmigration_repository.py
# HG changeset patch
# User Dimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
# Date 1387548377 -3600
# Fri Dec 20 15:06:17 2013 +0100
# Node ID 13051523ef6b117a2f5452ae1eb9b646f0707c27
# Parent c88982c8a936d158142b04fb20b5a5d369e28ea8
[dataimport, migration] more fixes in the spirit of a6c32edabc8d:

[entity, metadata] huuum, use resolvable url as cwuri... And fix existing ones.

diff --git a/dataimport.py b/dataimport.py
@@ -871,11 +871,11 @@
1 
2      def generate(self, entity, rtype):
3          return getattr(self, 'gen_%s' % rtype)(entity)
4 
5      def gen_cwuri(self, entity):
6 -        return u'%seid/%s' % (self.baseurl, entity.eid)
7 +        return u'%s%s' % (self.baseurl, entity.eid)
8 
9      def gen_creation_date(self, entity):
10          return self.time
11      def gen_modification_date(self, entity):
12          return self.time
diff --git a/misc/migration/bootstrapmigration_repository.py b/misc/migration/bootstrapmigration_repository.py
@@ -155,11 +155,11 @@
13          base_url = session.base_url()
14          for eid, in rql('Any X', ask_confirm=False):
15              type, source, extid = session.describe(eid)
16              if source == 'system':
17                  rql('SET X cwuri %(u)s WHERE X eid %(x)s',
18 -                    {'x': eid, 'u': base_url + u'eid/%s' % eid})
19 +                    {'x': eid, 'u': u'%s%s' % (base_url, eid)})
20          isession.commit()
21          session.set_shared_data('do-not-insert-cwuri', False)
22 
23  if applcubicwebversion < (3, 5, 0) and cubicwebversion >= (3, 5, 0):
24      # check that migration is not doomed