Skip to content
Snippets Groups Projects
Commit f4c6ce965e48 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

update selectors

parent a8d17f05b594
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
from logilab.mtconverter import html_escape 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): class ExpenseAccountingXmlView(EntityView):
id = 'accexpense' id = 'accexpense'
...@@ -13,7 +14,9 @@ ...@@ -13,7 +14,9 @@
class ExpenseAccountingXmlView(EntityView): class ExpenseAccountingXmlView(EntityView):
id = 'accexpense' id = 'accexpense'
__select__ = implements('Expense')
title = _('accounting entry view') title = _('accounting entry view')
templatable = False templatable = False
content_type = 'text/xml' content_type = 'text/xml'
...@@ -17,7 +20,6 @@ ...@@ -17,7 +20,6 @@
title = _('accounting entry view') title = _('accounting entry view')
templatable = False templatable = False
content_type = 'text/xml' content_type = 'text/xml'
accepts = ('Expense',)
def cell_call(self, row, col): def cell_call(self, row, col):
entity = self.entity(row, col) entity = self.entity(row, col)
...@@ -26,6 +28,8 @@ ...@@ -26,6 +28,8 @@
class ExpenseLineAccountingEntryXmlView(EntityView): class ExpenseLineAccountingEntryXmlView(EntityView):
id = 'accentry' id = 'accentry'
__select__ = implements('ExpenseLine',)
title = _('accounting entry view') title = _('accounting entry view')
templatable = False templatable = False
content_type = 'text/xml' content_type = 'text/xml'
...@@ -29,8 +33,7 @@ ...@@ -29,8 +33,7 @@
title = _('accounting entry view') title = _('accounting entry view')
templatable = False templatable = False
content_type = 'text/xml' content_type = 'text/xml'
accepts = ('ExpenseLine',)
def call(self): def call(self):
"""display a list of entities by calling their <item_vid> view """display a list of entities by calling their <item_vid> view
""" """
...@@ -39,7 +42,7 @@ ...@@ -39,7 +42,7 @@
for i in xrange(self.rset.rowcount): for i in xrange(self.rset.rowcount):
self.cell_call(i, 0) self.cell_call(i, 0)
self.w(u'</ecritures>\n') self.w(u'</ecritures>\n')
def cell_call(self, row, col): def cell_call(self, row, col):
entity = self.complete_entity(row, col) entity = self.complete_entity(row, col)
self.w(u' <ecriture date="%s">\n' % entity.diem.strftime('%Y-%m-%d')) self.w(u' <ecriture date="%s">\n' % entity.diem.strftime('%Y-%m-%d'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment