- 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]
+ ret = Todo.by_date_range_with_limits(self.conn, (start, end))
+ todos_by_date_range, start, end = ret
+ todos = [t for t in todos_by_date_range
+ if comment_pattern in t.comment
+ and ((not process_id) or t.process.id_ == process_id)]