Esempio n. 1
0
def reset():
    delete_all()
    course_list = students_parser.get_course_ids()

    for course_id in course_list:
        cname = course_id
        newCourse = Course()
        newCourse.cid = course_id
        newCourse.name = cname
        newCourse.put()

    db.delete(Summary().all())
    summary = Summary()
    summary.courses = ""
    summary.put()
Esempio n. 2
0
    def get(self):
        json = self.request.get("json", default_value="false")

        courses = Summary.all().fetch(1)[0].courses
#        self.response.out.write(courses)
        if json=="false":
            path = os.path.join(os.path.dirname(__file__), '../templates/main.html')
            self.response.out.write(template.render(path, {}))
        if json=="true":
            self.response.out.write(courses)