sheets module
- class sheets.sheets
Bases:
object- async AddCourse(dbObj)
Adds the course specified to the database
- Parameters
dbObj (db) – Database object from db class with functions for accessing remote database
- checkCourseExistance(course, dbObj)
Checks if the course provided by the parameter above exists in the database
- Parameters
course (String) – Code of course to be checked
dbObj (db) – Database object from db class with functions for accessing remote database
- Returns
returns true of the course exists in the db and false if the course does not exist in the database
- Return type
bool
- checkLabScheduleExistance(schedule_id, dbObj)
Checks if the a specific schedule already exists in the database, returns True if exists and false if does not exist.
- Parameters
schedule_id (String) – The schedule id that is being checked in the database
dbObj (db) – Database object from db class with functions for accessing remote database
- Returns
Returns true if activity with schedule_id exists in database, and False if it does not exist
- Return type
bool
- async createEnrollsID(student_id, code)
Creates the enrolls ID that is required when a student is enrolled in a course
- Parameters
student_id (String) – Student number of the student being enrolled
code (String) – The course code of the that student is enrolling in
- Returns
The enrolls ID of the student
- Return type
String
- createScheduleID(code, start, time)
Generates a schedule ID give the course code, start time and end time of the schedule
- Parameters
code (String) – Course code in which the schedule is being generated for
start (DateTime) – Start date of the scheduled activity
time (DateTime) – Start time for the scheduled activity
- Returns
Returns the schedule ID of the activity
- Return type
String
- gatherInsertQueries(query, newValues=None)
Combine multiple insert queries into one query, In order to allow one call to the db instead of multiple calls
- Parameters
query (String) – The first values to be inserted in the table, (Leading statements of the insert statements)
newValues (String, optional) – The additional values that have to the leading statement of the query, defaults to None
- Returns
The new query that has old values and the new values
- Return type
String
- async generateRegister(schedule_list, dbObj)
Generate the register of an activity that is scheduled and added to the database
- Parameters
schedule_list (list) – The list of scheduled activities that needs registers to be generated
dbObj (db) – Database object from db class with functions for accessing remote database
- generateRegisterId(student_no, schedule_id)
Generates register ID given a student number and schedule ID for an activity
- Parameters
student_no (String) – Student number of student whose is being added to the register
schedule_id (String) – The scheduled activity in which the register ID is being generated for
- Returns
Returns the generated register ID
- Return type
String
- async showCourses(dbObj)
Prints all the courses that are available in the database
- Parameters
dbObj (db) – Database object from db class with functions for accessing remote database
- async showLabSchedule(course, dbObj)
Shows the lab schedules that are scheduled in the database for a specific course
- Parameters
course (String) – The course code in which schedules need to be displayed
dbObj (db) – Database object from db class with functions for accessing remote database
- async showRegister(schedule_id, dbObj)
prints out the register information for a specific course schedule
- Parameters
schedule_id (String) – The schedule id of the register that must be printed out
dbObj (db) – Database object from db class with functions for accessing remote database
- async updateLabSchedule(dbObj)
Updates the lab scheduled in the database based on entries on the google sheets document
- Parameters
dbObj (db) – Database object from db class with functions for accessing remote database