Import cubicweb_skos instead of cubes.skos
authorFrank Bessou <frank.bessou@logilab.fr>
Mon, 01 Oct 2018 15:08:19 +0200
changeset 2964 9e6614f4159d
parent 2963 0b663b4c509f
child 2965 0c1e2d29a493
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.
cubicweb_seda/dataimport.py
cubicweb_seda/schema/__init__.py
cubicweb_seda/views/dataobject.py
--- a/cubicweb_seda/dataimport.py	Thu Sep 27 15:33:38 2018 +0200
+++ b/cubicweb_seda/dataimport.py	Mon Oct 01 15:08:19 2018 +0200
@@ -30,7 +30,7 @@
     cwuri2eid,
 )
 
-from cubes.skos import lcsv, sobjects as skos
+from cubicweb_skos import lcsv, sobjects as skos
 
 # If you want to add a vocabulary here, add it to the end of the list if you
 # want to create it in migration script by simply calling import_seda_schemes
--- a/cubicweb_seda/schema/__init__.py	Thu Sep 27 15:33:38 2018 +0200
+++ b/cubicweb_seda/schema/__init__.py	Mon Oct 01 15:08:19 2018 +0200
@@ -21,7 +21,7 @@
 from cubicweb import _
 from cubicweb.schema import ERQLExpression, RRQLExpression, RQLConstraint
 
-from cubes.skos import schema as skos
+from cubicweb_skos import schema as skos
 
 from .xsd2yams import MULTIPLE_CHILDREN
 
--- a/cubicweb_seda/views/dataobject.py	Thu Sep 27 15:33:38 2018 +0200
+++ b/cubicweb_seda/views/dataobject.py	Mon Oct 01 15:08:19 2018 +0200
@@ -26,7 +26,7 @@
 from cubicweb.web.views import uicfg, tabs, ibreadcrumbs
 
 from cubes.relationwidget import views as rwdg
-from cubes.skos.views import widgets as skos
+from cubicweb_skos.views import widgets as skos
 
 from ..xsd2yams import SCHEME_FROM_CONTAINER
 from ..entities import parent_and_container, simplified_profile, full_seda2_profile