- 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):