[entities] add eid to ISerializableAdapter
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 23 Dec 2015 15:44:28 +0100
changeset 11044 00c5ee272a6d
parent 11043 12db20aeda44
child 11045 615163b17558
[entities] add eid to ISerializableAdapter Life without an eid is made of sadness.
entities/adapters.py
entities/test/unittest_base.py
--- a/entities/adapters.py	Wed Dec 23 10:52:55 2015 +0100
+++ b/entities/adapters.py	Wed Dec 23 15:44:28 2015 +0100
@@ -363,6 +363,7 @@
         data = {
             'cw_etype': entity.cw_etype,
             'cw_source': entity.cw_metainformation()['source']['uri'],
+            'eid': entity.eid,
         }
         for rschema, __ in entity.e_schema.attribute_definitions():
             attr = rschema.type
--- a/entities/test/unittest_base.py	Wed Dec 23 10:52:55 2015 +0100
+++ b/entities/test/unittest_base.py	Wed Dec 23 15:44:28 2015 +0100
@@ -249,6 +249,7 @@
             expected = {
                 'cw_etype': u'CWGroup',
                 'cw_source': 'system',
+                'eid': entity.eid,
                 'cwuri': u'http://testing.fr/cubicweb/%s' % entity.eid,
                 'creation_date': entity.creation_date,
                 'modification_date': entity.modification_date,