home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Collect GET /calendar range from "?start=" and "?end=".
[plomtask]
/
plomtask
/
http.py
diff --git
a/plomtask/http.py
b/plomtask/http.py
index 0af96e7538c2cefd9febd1ac55dedc6fd95f4f90..b698fcbef94b73d790c6346e9bc8db7b5f4e7e33 100644
(file)
--- a/
plomtask/http.py
+++ b/
plomtask/http.py
@@
-29,7
+29,9
@@
class TaskHandler(BaseHTTPRequestHandler):
try:
conn, site, params = self._init_handling()
if 'calendar' == site:
try:
conn, site, params = self._init_handling()
if 'calendar' == site:
- html = self.do_GET_calendar(conn)
+ start = params.get('start', [''])[0]
+ end = params.get('end', [''])[0]
+ html = self.do_GET_calendar(conn, start, end)
elif 'day' == site:
date = params.get('date', [todays_date()])[0]
html = self.do_GET_day(conn, date)
elif 'day' == site:
date = params.get('date', [todays_date()])[0]
html = self.do_GET_day(conn, date)
@@
-41,10
+43,10
@@
class TaskHandler(BaseHTTPRequestHandler):
except HandledException as error:
self._send_msg(error)
except HandledException as error:
self._send_msg(error)
- def do_GET_calendar(self, conn: DatabaseConnection):
+ def do_GET_calendar(self, conn: DatabaseConnection
, start: str, end: str
):
"""Show Days."""
return self.server.jinja.get_template('calendar.html').render(
"""Show Days."""
return self.server.jinja.get_template('calendar.html').render(
- days=Day.all(conn))
+ days=Day.all(conn
, date_range=(start, end)
))
def do_GET_day(self, conn: DatabaseConnection, date: str):
"""Show single Day."""
def do_GET_day(self, conn: DatabaseConnection, date: str):
"""Show single Day."""