[PATCH eac] Import cubicweb_skos instead of cubes.skos

Frank Bessou frank.bessou at logilab.fr
Mon Oct 1 17:52:29 CEST 2018


# HG changeset patch
# User Frank Bessou <frank.bessou at logilab.fr>
# Date 1538400199 -7200
#      Mon Oct 01 15:23:19 2018 +0200
# Node ID 97bb7b1ea8ea551fc6b74079fb0e49ea9f88737a
# Parent  7b8516b0f4e55735b33aaf96e75c9f93c631776f
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r 97bb7b1ea8ea
Import cubicweb_skos instead of cubes.skos

When both cubes.skos and cubicweb_skos are used to import the same
module, appobjects are registered using the wrong objid.

This is particularly problematic in register_and_replace function of
registries which relies on the objid of appobjects to find which object
to replace.

diff --git a/cubicweb_eac/dataimport.py b/cubicweb_eac/dataimport.py
--- a/cubicweb_eac/dataimport.py
+++ b/cubicweb_eac/dataimport.py
@@ -31,7 +31,7 @@ from lxml import etree
 
 from cubicweb.dataimport.importer import ExtEntity
 
-from cubes.skos import to_unicode
+from cubicweb_skos import to_unicode
 
 from cubicweb_eac import TYPE_MAPPING, ADDRESS_MAPPING, MAINTENANCETYPE_MAPPING
 
diff --git a/cubicweb_eac/sobjects.py b/cubicweb_eac/sobjects.py
--- a/cubicweb_eac/sobjects.py
+++ b/cubicweb_eac/sobjects.py
@@ -21,7 +21,7 @@ from cubicweb.server import Service
 from cubicweb.dataimport import RQLObjectStore
 from cubicweb.dataimport.importer import ExtEntitiesImporter, cwuri2eid
 
-from cubes.skos import to_unicode
+from cubicweb_skos import to_unicode
 
 from cubicweb_eac import dataimport
 
diff --git a/cubicweb_eac/views.py b/cubicweb_eac/views.py
--- a/cubicweb_eac/views.py
+++ b/cubicweb_eac/views.py
@@ -33,7 +33,7 @@ from cubicweb.dataimport.importer import
 from cubicweb.web import action, component, formfields as ff, formwidgets as fw, httpcache
 from cubicweb.web.views import actions, calendar, cwsources, forms, idownloadable, uicfg
 
-from cubes.skos import to_unicode
+from cubicweb_skos import to_unicode
 
 from cubicweb_eac import dataimport
 



More information about the saem-devel mailing list