Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
awstats
Commits
f4e17f7eb392
Commit
5e674106
authored
May 26, 2011
by
Arthur Lutz
Browse files
cleanup
parent
43840b7dfba7
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
deleted
100644 → 0
View file @
43840b7d
# 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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment