controllers package

Submodules

controllers.courses module

Courses Controller

controllers.courses.building_by_id(cid)[source]
route: /buildings/<buildingid>
method: GET
Retrieves one building with id.
controllers.courses.faculties_by_id(cid)[source]
route: /buildings/<facultyid>
method: GET
Retrieves one faculty with id.
controllers.courses.list_buildings()[source]
route: /buildings
method: GET
Lists all the available buildings.
controllers.courses.list_courses()[source]
route: /courses
method: GET
Lists courses with pagination and text query.
controllers.courses.list_faculties()[source]
route: /faculties
method: GET
Lists all the faculties.
controllers.courses.list_one_course(cid)[source]
route: /courses/<cid>
method: GET
param: course crn
Retrieves one course.
controllers.courses.sync_buildings()[source]
route: /buildings/sync
method: POST
Crawles all the building data from ITU website and writes to database.
controllers.courses.sync_courses()[source]
route: /courses/sync
method: POST
Crawles courses data from the ITU website and writes to database.
controllers.courses.sync_faculties()[source]
route: /faculties/sync
method: POST
Crawles all the faculties data from ITU website and writes to database.

controllers.students module

controllers.students.enroll_course(student, courseid)[source]
Parameters:student – current logged in student from auth decorator.
route: /students/courses/<crn>
method: POST
Enrolls a course with given CRN.
route: /students/courses/<crn>
method: DELETE
Leaves a course with given CRN.
controllers.students.join_study_group(student, studygroupid)[source]
Parameters:student – current logged in student from auth decorator.
route: /students/studygroups/<studygroupid>
method: GET
Joins a study group.
controllers.students.list_student_courses(student)[source]
Parameters:student – current logged in student from auth decorator.
route: /students/courses
method: GET
Lists all the courses of a student.
controllers.students.list_student_studygroups(student)[source]
Parameters:student – current logged in student from auth decorator.
route: /students/studygroups
method: GET
List all the created study groups.
controllers.students.one_student(student)[source]
Parameters:student – current logged in student from auth decorator.
route: /students
method: GET
Retrieves one student with id.
route: /students
method: PUT
body: {“study_start”: [timestamp], “study_end”: [timestamp]}
Updates one student study time preference with id.
controllers.students.student_login()[source]
route: /auth
method: POST
body: {“username”: [string], “password”: [string], “pin”: [string]}
Makes authentication with ITU username, password and pin number.
controllers.students.student_logout()[source]
route: /logout
method: POST
Logs out the logged in user.

controllers.chatGroup module

controllers.chatGroup.leave_chatgroup(cid)[source]

Leave room endpoint

controllers.chatGroup.show_groups(student)[source]

GET request show all the groups of student.

POST request allows student to form a group. Returns the new list of student’s groups

controllers.chatGroup.students_group(student, cid)[source]

GET request will show the group to student

PUT request will add student to chatgroup. Returns a JSON object of members of group including the new one.

DELETE request will remove student from chat. Returns a JSON object of members of group excluding the new one.

controllers.comments module

controllers.comments.comments(student)[source]

POST request will add comment to student

DELETE request will remove the comment

controllers.comments.getCommentsOfStudent(sid)[source]

Returns a JSON containing comments of specific student

controllers.homeworks module

controllers.homeworks.homework(student)[source]

GET Request returns a JSON containing the homeworks of student

POST Request adds a new homework to student. Return a JSON containing the homeworks of student including new added

PUT Request alters the homework’s information

DELETE Request removes homework from student

controllers.lecturers module

controllers.lecturers.lecturer()[source]

GET request shows lecturers of given department

POST request creates new lecturer

DELETE request deletes a lecturer

PUT request updates the lecturer

controllers.lecturers.show_a_lecturer(lid)[source]

controllers.studygroups module

Study Group endpoints.

controllers.studygroups.check_study_group(student, groupid)[source]
Parameters:
  • student – student id.
  • groupid – group id.

Checks if the student owns the study group.

controllers.studygroups.find_studygroups_of_student(student, studentid)[source]
Parameters:student – current logged in student from auth decorator.
route: /studygroups/students/<studentid>
method: GET
Finds all the study groups of a student participated.
controllers.studygroups.find_update_studygroup(student, groupid)[source]
Parameters:student – current logged in student from auth decorator.
route: /studygroups/<groupid>
method: GET
With given id parameter finds the studygroup.

method: POST
With given id parameter updates the studygroup.

method: DELETE
With given id parameter removes the studygroup.
controllers.studygroups.list_studygroup_students(student, groupid)[source]
Parameters:student – current logged in student from auth decorator.
route: /studygroups/<groupid>/students
method: GET
Lists all the students of the studygroup with the given id.
controllers.studygroups.list_studygroups(student)[source]
Parameters:student – current logged in student from auth decorator.
route: /studygroups
method: GET
Lists all available studygroups for the caller student.
controllers.studygroups.set_student_studygroup_status(student, groupid, studentid)[source]
Parameters:student – current logged in student from auth decorator.
route: /studygroups/<groupid>/students/<studentid>/status
method: POST
Updates the group status of a student in the studygroup with the given id.

Module contents

REST API Route bindings.