X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=a2e8fa69fd05d4423751a4fa3ad3623ed4dffe8c;hb=f92de64d072009c8c4bf96b9eeb9fa245045662b;hp=b81083b26e35a4d3a6dfb140781d95f14bae5c3c;hpb=f79031c51b888d66448d18b159f17fbe28c7885c;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index b81083b..a2e8fa6 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -5,7 +5,8 @@ from http.server import HTTPServer from urllib.parse import urlparse, parse_qs from os.path import split as path_split from jinja2 import Environment as JinjaEnv, FileSystemLoader as JinjaFSLoader -from plomtask.days import Day, todays_date +from plomtask.dating import todays_date +from plomtask.days import Day from plomtask.exceptions import HandledException, BadFormatException, \ NotFoundException from plomtask.db import DatabaseConnection, DatabaseFile @@ -160,11 +161,9 @@ class TaskHandler(BaseHTTPRequestHandler): process_id = self.params.get_int_or_none('process_id') comment_pattern = self.params.get_str('comment_pattern') todos = [] - for t in Todo.matching(self.conn, comment_pattern): - # pylint: disable=too-many-boolean-expressions - if (start and t.date < start)\ - or (end and t.date > end)\ - or (process_id and t.process.id_ != process_id): + for t in Todo.by_date_range(self.conn, (start, end)): + if (process_id and t.process.id_ != process_id)\ + or (comment_pattern not in t.comment): continue todos += [t] if sort_by == 'doneness':