# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1243429586 -7200 # Wed May 27 15:06:26 2009 +0200 # Node ID f4c6ce965e481f34fe0002f6c5efc569a227882b # Parent a8d17f05b594cf9d38cd2310ab5c0aa2b219a87a update selectors diff --git a/views/accounting.py b/views/accounting.py --- a/views/accounting.py +++ b/views/accounting.py @@ -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'))