Commit 5e674106 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

cleanup

parent 43840b7dfba7
# copyright 2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr -- mailto:contact@logilab.fr
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 2.1 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-awstats views/forms/actions/components for web ui"""
from cubicweb.web.views import primary
from cubicweb.selectors import is_instance
class StatPeriodPrimaryView(primary.PrimaryView):
__select__ = is_instance('StatPeriod')
def cell_call(self, row, col):
entity = self.cw_rset.get_entity(row, col)
self.w(u'<h1>%s %s - %s</h1>' % (_('Stats for period :'), entity.start, entity.stop) )
# TODO - could loop over hit_type and make tabs
rql = 'Any X, T, C ORDERBY C DESC WHERE H is Hits, H stats_about X, H hit_type T, H count C, H period P, P eid %(e)s'
rset = self._cw.execute(rql, {'e':entity.eid})
self.w(self._cw.view('table', rset))
def registration_callback(vreg):
vreg.register(StatPeriodPrimaryView)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment