# HG changeset patch # User Sylvain Thénault # Date 1260290906 -3600 # Node ID 5838a4b0766d1f910c7e3a9074e948358aaeeea4 # Parent 12c4f7e2bed61e09af6bfc619fcc3691116060b8 3.5 api update diff -r 12c4f7e2bed6 -r 5838a4b0766d entity.py --- a/entity.py Tue Dec 08 17:48:06 2009 +0100 +++ b/entity.py Tue Dec 08 17:48:26 2009 +0100 @@ -176,7 +176,7 @@ # that case the relation may still be missing. As we miss this # later information here, systematically add it. restrictions[-1] += '?' - # XXX user.req.vreg iiiirk + # XXX user._cw.vreg iiiirk destcls = user._cw.vreg['etypes'].etype_class(desttype) destcls._fetch_restrictions(var, varmaker, destcls.fetch_attrs, selection, orderby, restrictions, @@ -795,9 +795,9 @@ relations of the given type from or to this object should be deleted). """ if _cw_unsafe: - execute = self.req.unsafe_execute + execute = self._cw.unsafe_execute else: - execute = self.req.execute + execute = self._cw.execute # XXX update cache for attr, values in kwargs.iteritems(): if attr.startswith('reverse_'): diff -r 12c4f7e2bed6 -r 5838a4b0766d sobjects/test/unittest_supervising.py --- a/sobjects/test/unittest_supervising.py Tue Dec 08 17:48:06 2009 +0100 +++ b/sobjects/test/unittest_supervising.py Tue Dec 08 17:48:26 2009 +0100 @@ -17,10 +17,11 @@ class SupervisingTC(CubicWebTC): def setup_database(self): - self.add_entity('Card', title=u"une news !", content=u"cubicweb c'est beau") - self.add_entity('Card', title=u"une autre news !", content=u"cubicweb c'est beau") - self.add_entity('Bookmark', title=u"un signet !", path=u"view?vid=index") - self.add_entity('Comment', content=u"Yo !") + req = self.request() + req.create_entity('Card', title=u"une news !", content=u"cubicweb c'est beau") + req.create_entity('Card', title=u"une autre news !", content=u"cubicweb c'est beau") + req.create_entity('Bookmark', title=u"un signet !", path=u"view?vid=index") + req.create_entity('Comment', content=u"Yo !") self.execute('SET C comments B WHERE B title "une autre news !", C content "Yo !"') self.vreg.config.global_set_option('supervising-addrs', 'test@logilab.fr')