From d4a47143804746a3f071508ed7229cffeb1cf8c6 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Sun, 28 Nov 2010 19:14:50 +0000 Subject: [PATCH] First Idea to handle reports --- controllers/reports.py | 38 +++++++++++++++++++++++++++++++++++++ views/reports/report_1.html | 23 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 controllers/reports.py create mode 100644 views/reports/report_1.html diff --git a/controllers/reports.py b/controllers/reports.py new file mode 100644 index 00000000..1202b751 --- /dev/null +++ b/controllers/reports.py @@ -0,0 +1,38 @@ +""" $Id$ """ + + +def index(): + """Main Controller handling report. + + """ + return 'Report section' + + +def report_1(): + """First trial + + """ + # Resolve foreign key + query = db.publications.id_collaborations == db.collaborations.id + query = (query) & (db.publications.id_publishers == db.publishers.id) + query = (query) & (db.publications.id_categories_aeres == db.categories_aeres.id) + + # publication with comite de lecture + query = (query) & (db.publications.conference_title == '') + query = (query) & ((db.categories_aeres.code == 'ACL') | (db.categories_aeres.code == 'ACLN')) + + # Interrogate the database + rows = db(query).select(db.publications.title, + db.publications.authors, + db.collaborations.collaboration, + db.publishers.abbreviation, + db.publications.year, + db.publications.doi, + db.publications.volume, + db.publications.first_page, + db.publications.last_page, + db.publications.conference_title, + db.categories_aeres.code) + + + return {'title': 'Rapport 1', 'publis': rows} diff --git a/views/reports/report_1.html b/views/reports/report_1.html new file mode 100644 index 00000000..2adfcdcc --- /dev/null +++ b/views/reports/report_1.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <title>{{=title}}</title> + </head> + <body> + <h2>Publications avec comité de lecture</h2> + <ol> + {{for el in publis:}} + <li> + {{=el.publications.title}}<br> + {{=el.publications.authors}}<br> + {{if el.publishers.abbreviation:}}{{=el.publishers.abbreviation}}{{pass}} + {{if el.publications.volume:}}{{=el.publications.volume}}{{pass}} + {{if el.publications.year:}}({{=el.publications.year}}){{pass}} + {{if el.publications.first_page:}}{{=el.publications.first_page}}{{pass}} + {{if el.publications.last_page:}}- {{=el.publications.last_page}}{{pass}} + </li> + {{pass}} + </ol> + </body> +</html> -- GitLab