cw 3.10 api updates stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Feb 2011 11:56:26 +0100
branchstable
changeset 46 efe4197be8e1
parent 41 6f326f9908bd
child 47 016c22579175
cw 3.10 api updates
entities.py
views/accounting.py
views/actions.py
--- a/entities.py	Thu Apr 15 16:30:21 2010 +0200
+++ b/entities.py	Thu Feb 10 11:56:26 2011 +0100
@@ -7,7 +7,7 @@
     @property
     def workcase(self):
         rql = 'Any R WHERE E has_lines EL, EL eid %(el)s, E spent_for W, W ref R'
-        rset = self._cw.execute(rql, {'el': self.eid}, 'el')
+        rset = self._cw.execute(rql, {'el': self.eid})
         if rset:
             return rset[0][0]
         return None
--- a/views/accounting.py	Thu Apr 15 16:30:21 2010 +0200
+++ b/views/accounting.py	Thu Feb 10 11:56:26 2011 +0100
@@ -9,13 +9,13 @@
 
 from logilab.mtconverter import xml_escape
 
-from cubicweb.selectors import implements
+from cubicweb.selectors import is_instance
 from cubicweb.view import EntityView
 
 
 class ExpenseAccountingXmlView(EntityView):
     __regid__ = 'accexpense'
-    __select__ = implements('Expense')
+    __select__ = is_instance('Expense')
 
     title = _('accounting entry view')
     templatable = False
@@ -41,7 +41,7 @@
 
 class ExpenseLineAccountingEntryXmlView(EntityView):
     __regid__ = 'accentry'
-    __select__ = implements('ExpenseLine',)
+    __select__ = is_instance('ExpenseLine',)
 
     title = _('accounting entry view')
     templatable = False
--- a/views/actions.py	Thu Apr 15 16:30:21 2010 +0200
+++ b/views/actions.py	Thu Feb 10 11:56:26 2011 +0100
@@ -6,12 +6,12 @@
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb.selectors import implements
+from cubicweb.selectors import is_instance
 from cubicweb.web.action import Action
 
 class AccountingAction(Action):
     __regid__ = 'accaction'
-    __select__ = implements('Expense')
+    __select__ = is_instance('Expense')
     title = _('generate accounting entries')
 
     def url(self):