# HG changeset patch # User Laurent Peuch # Date 1557962631 -7200 # Node ID ea15ac05c4476762ac07c5ef7c23f94b4abf8445 # Parent c755b73640ea04629c77e20c575f4a5ed7e0beda [enh] display CWConstraint type in its repr This will change CWConstraint repr from something like: To: To help improve debugging UX a little bit. diff -r c755b73640ea -r ea15ac05c447 cubicweb/entities/schemaobjs.py --- a/cubicweb/entities/schemaobjs.py Wed May 15 14:23:19 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 '' % ( + 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'')