gbmodel/model_sqlalchemy.py
def remove_team_from_session(self, name, session_id):
        """
        Remove a team and all the students from that team
        Input: name of the team and session id
        Output: True if the operation completed successfully. False if something went wrong
        """
        try:
            student = students()
            removed_student = removed_students()
            result = teams.query.filter(teams.name == name,
                                        teams.session_id == session_id).first()

            # get students to delete
            tid = result.id
            list_students = student.get_students(tid)
            if list_students is not None:
                for i in list_students:
                    result = students.query.filter(students.name == i,
                                                   students.session_id == session_id).first()
                    removed_student.add_student(result)
            student_list = students.query.filter(students.tid == tid,
                                                 students.session_id == session_id).all()
            # remove reports
            reviews = reports.query.filter(reports.tid == tid).all()
            for review in reviews:
                db.session.delete(review)

            # remove students
            for i in student_list:
                db.session.delete(i)
                db.session.commit()
            team = teams.query.filter(teams.id == tid, teams.session_id == session_id).first()
            db.session.delete(team)
            db.session.commit()
            return True
        except exc.SQLAlchemyError:
            handle_exception()
            return False

        Remove a team and all the students from that team
        Input: name of the team and session id
        Output: True if the operation completed successfully. False if something went wrong
        
Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully. False if something went wrong
Remove a team and all the students from that team Input : name of the team and session id Output : True if the operation completed successfully . False if something went wrong
def remove_team_from_session(self, name, session_id):
        try:
            student = students()
            removed_student = removed_students()
            result = teams.query.filter(teams.name == name,
                                        teams.session_id == session_id).first()
            tid = result.id
            list_students = student.get_students(tid)
            if list_students is not None:
                for i in list_students:
                    result = students.query.filter(students.name == i,
                                                   students.session_id == session_id).first()
                    removed_student.add_student(result)
            student_list = students.query.filter(students.tid == tid,
                                                 students.session_id == session_id).all()
            reviews = reports.query.filter(reports.tid == tid).all()
            for review in reviews:
                db.session.delete(review)
            for i in student_list:
                db.session.delete(i)
                db.session.commit()
            team = teams.query.filter(teams.id == tid, teams.session_id == session_id).first()
            db.session.delete(team)
            db.session.commit()
            return True
        except exc.SQLAlchemyError:
            handle_exception()
            return False
def remove_team_from_session ( self , name , session_id ) : try : student = students ( ) removed_student = removed_students ( ) result = teams . query . filter ( teams . name == name , teams . session_id == session_id ) . first ( ) tid = result . id list_students = student . get_students ( tid ) if list_students is not None : for i in list_students : result = students . query . filter ( students . name == i , students . session_id == session_id ) . first ( ) removed_student . add_student ( result ) student_list = students . query . filter ( students . tid == tid , students . session_id == session_id ) . all ( ) reviews = reports . query . filter ( reports . tid == tid ) . all ( ) for review in reviews : db . session . delete ( review ) for i in student_list : db . session . delete ( i ) db . session . commit ( ) team = teams . query . filter ( teams . id == tid , teams . session_id == session_id ) . first ( ) db . session . delete ( team ) db . session . commit ( ) return True except exc . SQLAlchemyError : handle_exception ( ) return False
Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully.
Remove a team and all the students from that team Input : name of the team and session id Output : True if the operation completed successfully .
"""
        Remove a team and all the students from that team
        Input: name of the team and session id
        Output: True if the operation completed successfully. False if something went wrong
        """ # get students to delete # remove reports # remove students
self
name
session_id