def EditSupportTask(session, id, st): task = list(session.query(Activity.Assignment).filter(Activity.Assignment.objectId == id))[0] task.person = st["person"] task.task_phase = st["type"] task.planned_start_date = st["start_date"] task.planned_num_weeks = st["duration"] task.forecast_end_date = Activity.getEndDate(st['start_date'], float(st["duration"])) task.activity_id = st["activity_id"] task.work_load = st["workload"] session.commit()
def AddSupportTask(session, st): if st["duration"]=='': durationCount = 0 expectedEnd = '' else: durationCount = st["duration"] expectedEnd = Activity.getEndDate(st['start_date'], float(st["duration"])) if st["type"]=="300": setname = st["person"]+" On Vacation" elif st["type"] == "301": setname = "Other" else: setname = st["team"] +":"+st["person"] + " Support Task" task = Activity.Assignment(name = setname, team = st["team"], activity_id = st["activity_id"],person = st["person"], task_phase = st["type"],\ planned_start_date = st["start_date"],planned_num_weeks = durationCount, work_load=st["workload"], forecast_start_date='',\ forecast_end_date = expectedEnd,actual_start_date='', actual_end_date='', status = 0, predecessor="[]", successor="[]",description='') session.add(task) session.commit()