def add_competence(student_id, compet, project_id): db = Database() id_compet = db.SqlQueryScalar(GET_ID_COMPET_BY_NAME, compet) if not id_compet: id_compet = db.SqlQueryScalar(INSERT_COMPET, compet) return db.SqlQueryRecord(ADD_COMPET_IN_USER, student_id, id_compet, project_id)
def get_project_info(id): db = Database() info = db.SqlQueryRecord(GET_ALL_INFO_ABOUT_PROJECT, id) info['students'] = db.SqlQuery(GET_ALL_STUDENTS_BY_PROJECT, id) return info