[PATCH 1 of 3 eac V3] Rename EACFunctionRelation `attributes` to `xml_attributes`

Guillaume Vandevelde guillaume.vandevelde at logilab.fr
Mon Aug 19 19:06:44 CEST 2019


# HG changeset patch
# User Guillaume Vandevelde <gvandevelde at logilab.fr>
# Date 1566226030 -7200
#      Mon Aug 19 16:47:10 2019 +0200
# Node ID 0913a7add7dc48229faa09ad8a59d75e07442b6f
# Parent  862c6e01b2f47a53c7a1bc08225e4411f9b3f74b
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r 0913a7add7dc
Rename EACFunctionRelation `attributes` to `xml_attributes`

diff -r 862c6e01b2f4 -r 0913a7add7dc cubicweb_eac/dataimport.py
--- a/cubicweb_eac/dataimport.py	Mon Aug 19 15:32:35 2019 +0200
+++ b/cubicweb_eac/dataimport.py	Mon Aug 19 16:47:10 2019 +0200
@@ -868,7 +868,7 @@
              ('relation_entry', 'eac:relationEntry'))))
         attrib = sorted(dict(elem.attrib).items())
         if attrib:
-            values.update({'attributes': set([text_type(attrib)])})
+            values.update({'xml_attributes': set([text_type(attrib)])})
         yield ExtEntity('EACFunctionRelation', self._gen_extid(), values)
 
     @add_xml_wrap_for('EACResourceRelation')
diff -r 862c6e01b2f4 -r 0913a7add7dc cubicweb_eac/entities.py
--- a/cubicweb_eac/entities.py	Mon Aug 19 15:32:35 2019 +0200
+++ b/cubicweb_eac/entities.py	Mon Aug 19 16:47:10 2019 +0200
@@ -149,7 +149,7 @@
                                                 'description',
                                                 'relation_entry',
                                                 'place_entry',
-                                                'attributes',))
+                                                'xml_attributes',))
 
     @property
     def record(self):
diff -r 862c6e01b2f4 -r 0913a7add7dc cubicweb_eac/schema.py
--- a/cubicweb_eac/schema.py	Mon Aug 19 15:32:35 2019 +0200
+++ b/cubicweb_eac/schema.py	Mon Aug 19 16:47:10 2019 +0200
@@ -379,7 +379,7 @@
     description = RichString(fulltextindexed=True)
     relation_entry = String(fulltextindexed=True)
     place_entry = String(fulltextindexed=True)
-    attributes = String(fulltextindexed=True)
+    xml_attributes = String(fulltextindexed=True)
 
 
 class function_relation_agent(RelationDefinition):
diff -r 862c6e01b2f4 -r 0913a7add7dc test/test_dataimport.py
--- a/test/test_dataimport.py	Mon Aug 19 15:32:35 2019 +0200
+++ b/test/test_dataimport.py	Mon Aug 19 16:47:10 2019 +0200
@@ -424,10 +424,11 @@
                                u'">Boschiero\n\t      </namePart>\n\t      <role>\n\t\t<roleTerm'
                                u' type="text">autore\n\t\t</roleTerm>\n\t      </role>\n\t'
                                u'    </name>\n\t  </mods>\n\t']),
-              'attributes': set([u"[('{http://www.w3.org/1999/xlink}actuate', 'onLoad'),"
-                                 u" ('{http://www.w3.org/1999/xlink}arcrole',"
-                                 u" 'http://test_arcrole.lol.com'), ('{http://www.w3."
-                                 u"org/1999/xlink}role', 'http://test_role.lmao.com')]"])
+              'xml_attributes': set([u"[('{http://www.w3.org/1999/xlink}actuate', 'onLoad'), "
+                                     u"('{http://www.w3.org/1999/xlink}arcrole', "
+                                     u"'http://test_arcrole.lol.com'), "
+                                     u"('{http://www.w3.org/1999/xlink}role', "
+                                     u"'http://test_role.lmao.com')]"])
               },
              ),
             ('EACFunctionRelation', _gen_extid(),
@@ -767,7 +768,7 @@
                                                 u"{http://www.w3.org/1999/xlink}type": u"simple"})
         rset = cnx.find('EACFunctionRelation', r_type=u'performs')
         func_relation = rset.one()
-        self.assertEqual(func_relation.attributes,
+        self.assertEqual(func_relation.xml_attributes,
                          u"[('{http://www.w3.org/1999/xlink}actuate', "
                          u"'onLoad'), ('{http://www.w3.org/1999/xlink}arcrole',"
                          u" 'http://test_arcrole.lol.com'), ('{http://www.w3.org"



More information about the saem-devel mailing list