[entities] display CWConstraint type in its repr 3.26
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 16 May 2019 01:23:51 +0200
branch3.26
changeset 12605 bd6ba326765e
parent 12599 0357c05f203e
child 12615 7abe23cbfda1
[entities] display CWConstraint type in its repr
cubicweb/entities/schemaobjs.py
--- a/cubicweb/entities/schemaobjs.py	Wed May 15 15:44:35 2019 +0200
+++ b/cubicweb/entities/schemaobjs.py	Thu May 16 01:23:51 2019 +0200
@@ -141,6 +141,10 @@
     __regid__ = 'CWConstraint'
     fetch_attrs, cw_fetch_order = fetch_config(['value'])
 
+    def __repr__(self):
+        return '<Entity %s %s of type %s %s at %s>' % (
+            self.e_schema, self.eid, self.type, list(self.cw_attr_cache), id(self))
+
     def dc_title(self):
         return '%s(%s)' % (self.cstrtype[0].name, self.value or u'')