Commit 8e9fc51f authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Rename list_tools as reporting_tools and ListTool as Report.

parent f0c783b3
......@@ -6,9 +6,9 @@ import re
from gluon.dal import Field
from list_postprocessing import *
from list_tools import (ListTool,
get_sections,
get_selector)
from reporting_tools import (Report,
get_sections,
get_selector)
MSG_NO_LIST = T("Please select a list....")
......@@ -31,7 +31,7 @@ def index():
# get the user requirements
# download the list as a file with a given format
tool = ListTool(db)
tool = Report(db)
tool.decode_request()
iframe = tool.download()
if iframe:
......
......@@ -3,9 +3,9 @@
"""
import re
from list_tools import (Diplomas,
Publications,
get_selector)
from reporting_tools import (Diplomas,
Publications,
get_selector)
MSG_NO_METRIC = T("Please select a metric....")
......
"""list tools module
"""reporting tools module
A collection of tools to build publication lists
in controllers.
A collection of tools to build reports in controllers.
"""
from gluon import current
......@@ -121,8 +120,11 @@ def get_selector(*fields):
return (di[el] for el in fields)
class ListTool(object):
"""Basic tool to build a publication list.
class Report(object):
"""Basic tool to build a report.
It analyses data send by the selector widget in order
to determine the user constraints.
"""
def __init__(self, db, extfield='format'):
......@@ -137,8 +139,8 @@ class ListTool(object):
def decode_request(self):
"""Decode the current request in order to extract the
parameters to build the list.
"""Decode the current selector request in order to extract the
parameters to build the report.
"""
for key in current.request.vars:
......@@ -164,7 +166,7 @@ class ListTool(object):
def download(self):
"""The list can be download and receive as a file with a given format.
"""The report can be download and receive as a file with a given format.
this method initiate this process by return and IFRAME.
The IFRAME is used by the browser to download the file.
......@@ -213,6 +215,7 @@ class ListTool(object):
Return the query.
To implement for each inherited class.
"""
return None
......@@ -239,7 +242,7 @@ class ListTool(object):
return range(y1, y2+1)
class Diplomas(ListTool):
class Diplomas(Report):
def query(self):
"""Build the database query for the diploma table
......@@ -273,7 +276,7 @@ class Diplomas(ListTool):
return query
class Publications(ListTool):
class Publications(Report):
def query(self):
"""Build the database query for the publication table
......
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