update selectors
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 27 May 2009 15:06:26 +0200
changeset 15 f4c6ce965e48
parent 14 a8d17f05b594
child 16 5ca858315bbb
update selectors
views/accounting.py
--- a/views/accounting.py	Wed May 27 15:04:50 2009 +0200
+++ b/views/accounting.py	Wed May 27 15:06:26 2009 +0200
@@ -9,15 +9,17 @@
 
 from logilab.mtconverter import html_escape
 
-from cubicweb.common.view import EntityView
+from cubicweb.selectors import implements
+from cubicweb.view import EntityView
 
 
 class ExpenseAccountingXmlView(EntityView):
     id = 'accexpense'
+    __select__ = implements('Expense')
+
     title = _('accounting entry view')
     templatable = False
     content_type = 'text/xml'
-    accepts = ('Expense',)
 
     def cell_call(self, row, col):
         entity = self.entity(row, col)
@@ -26,11 +28,12 @@
 
 class ExpenseLineAccountingEntryXmlView(EntityView):
     id = 'accentry'
+    __select__ = implements('ExpenseLine',)
+
     title = _('accounting entry view')
     templatable = False
     content_type = 'text/xml'
-    accepts = ('ExpenseLine',)
-        
+
     def call(self):
         """display a list of entities by calling their <item_vid> view
         """
@@ -39,7 +42,7 @@
         for i in xrange(self.rset.rowcount):
             self.cell_call(i, 0)
         self.w(u'</ecritures>\n')
-    
+
     def cell_call(self, row, col):
         entity = self.complete_entity(row, col)
         self.w(u'  <ecriture date="%s">\n' % entity.diem.strftime('%Y-%m-%d'))