def tasks(self): return db_session.query(Task.plan, func.count(Task.id)).group_by(Task.plan).all()
def task_count(self, task_number): return db_session.query( func.count(Task.id)).filter(Task.plan == task_number).one()[0]
def total_tasks(self): return db_session.query(func.count(Task.id)).one()[0]