Ejemplo n.º 1
0
 def upsertSchedule(self, request, d_key, message_ID):
     ''' insert or update Schedule entity'''
     schedule = Schedule(year=request.year,
                         quarter=request.quarter,
                         department=d_key,
                         course=ndb.Key(Course, request.course_id))
     print("Inserted the course under dept = ", d_key.get().name)
     schedule.put()
     return STORED_RESPONSES.items[message_ID]
Ejemplo n.º 2
0
 def upsertSchedule(self, year, quarter, d_key, course_id):
     ''' insert or update Schedule entity'''
     schedule = Schedule(year=year,
                         quarter=quarter,
                         department=d_key,
                         course=ndb.Key(Course, course_id))
     #print("Inserted the course under dept = ", d_key.get().name)
     sch_key = schedule.put()
     return R_SUCC_INSERT.format("Schedule", str(sch_key))