[PATCH 09 of 14 skos] Use entity_type method instead of deprecated entity_metas

Denis Laxalde denis.laxalde at logilab.fr
Mon Feb 19 12:28:00 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1519036614 -3600
#      Mon Feb 19 11:36:54 2018 +0100
# Node ID 0256cb3dc9a1c75511c61a07ed830f486004eca8
# Parent  386b280bc7f07f049a09df2b9dba0d57db039181
Use entity_type method instead of deprecated entity_metas

The latter is deprecated since cubicweb 3.24.

Related to #17133718.

diff --git a/dataimport.py b/dataimport.py
--- a/dataimport.py
+++ b/dataimport.py
@@ -38,7 +38,7 @@ def ext_dump_relations(cnx, extid2eid, e
     argument, to attempt to work around store's limitation on inlined relation.
     """
     eid = extid2eid[extentity.extid]
-    etype = cnx.entity_metas(eid)['type']
+    etype = cnx.entity_type(eid)
     relations = []
     rschema = cnx.vreg.schema.rschema
     for subj, rtype, obj in dump_relations(cnx, eid, etype):
@@ -120,7 +120,7 @@ def store_skos_extentities(cnx, store, e
         except KeyError:
             pass
         else:
-            if extentity.etype == 'Concept' and cnx.entity_metas(eid)['type'] == 'ExternalUri':
+            if extentity.etype == 'Concept' and cnx.entity_type(eid) == 'ExternalUri':
                 # We have replaced the external uri by the new concept. As entities.extid column is
                 # unique, we've to drop the external uri before inserting the concept, so we:
                 #  1. record every relations from/to the external uri,



More information about the saem-devel mailing list