コード例 #1
0
ファイル: db.py プロジェクト: rjose/dovetail
def select_project(connection, project_id):
    result = Project(project_id)
    data = connection.execute(
        database.projects.select(
            database.projects.c.id == project_id)).first()

    result.name = data['name']
    # NOTE: We don't need to condition them because we're not doing an explicit select
    # SqlAlchemy takes care of the date manipulation for us
    result.target_date = data['target_date']
    result.est_end_date = data['est_end_date']
    result.participants = people_db.select_project_participants(
        connection, project_id)
    result.work = work_db.select_work_for_project(connection, project_id)
    return result