Mercurial > roundup-cc
comparison roundup_cc_display.py @ 31:9aca070c86bd
Add the filter 'priority' for the search by status.
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 19:34:53 +0100 |
parents | 8d86ba8dee42 |
children | 80bbd06fe8ec |
comparison
equal
deleted
inserted
replaced
30:0d6504d02a6b | 31:9aca070c86bd |
---|---|
31 keywords = config.get("SEARCH", "Keywords", fallback="") | 31 keywords = config.get("SEARCH", "Keywords", fallback="") |
32 | 32 |
33 | 33 |
34 search = config.get("SEARCH", "Search", fallback="prio") | 34 search = config.get("SEARCH", "Search", fallback="prio") |
35 if search == "prio": | 35 if search == "prio": |
36 status = config.get("SEARCH", "Status", fallback="") | 36 search_parameters = config.get("SEARCH", "Status", fallback="") |
37 columns = config.get("SEARCH", "Priority", fallback=PRIO) | 37 columns = config.get("SEARCH", "Priority", fallback=PRIO) |
38 noPrio = config.get("SEARCH", "IncludeNoPrio", fallback=False) | 38 noPrio = config.get("SEARCH", "IncludeNoPrio", fallback=False) |
39 if noPrio: | 39 if noPrio: |
40 columns += ", None" | 40 columns += ", None" |
41 | 41 |
42 elif search == "status": | 42 elif search == "status": |
43 columns = config.get("SEARCH", "Status", fallback=STATES) | 43 columns = config.get("SEARCH", "Status", fallback=STATES) |
44 status = "" | 44 search_parameters = config.get("SEARCH", "Priority", fallback="") |
45 | 45 |
46 else: | 46 else: |
47 print("Incorrect [SEARCH]Search parameter. (prio, status)") | 47 print("Incorrect [SEARCH]Search parameter. (prio, status)") |
48 return | 48 return |
49 | 49 |
52 | 52 |
53 cgitb.enable() # (optional) HTML traceback to browser | 53 cgitb.enable() # (optional) HTML traceback to browser |
54 #render_db_stats_as_html("./demo1.db", rcd.SELECT_ALL) | 54 #render_db_stats_as_html("./demo1.db", rcd.SELECT_ALL) |
55 render_db_stats_as_html(db, | 55 render_db_stats_as_html(db, |
56 rcd.build_sql_select(columns).format("timestamp > date('now', '-2 month')"), | 56 rcd.build_sql_select(columns).format("timestamp > date('now', '-2 month')"), |
57 columns, status, keywords) | 57 columns, search_parameters, keywords) |
58 | 58 |
59 if __name__ == '__main__': | 59 if __name__ == '__main__': |
60 main() | 60 main() |