Пример #1
0
 def add_course(user_email, course_name):
     """
     Link a user and a course
     """
     from lib.UserCourse import UserCourse
     user_ref = User.get_by_key_name(user_email)
     course_ref = Course.get_by_key_name(course_name)
     new_user_course = UserCourse(user=user_ref, course=course_ref)
     new_user_course.put()
Пример #2
0
 def remove_course(university_name, course_name):
     """
     Unlink a university and a course
     """
     university_ref = University.get_by_key_name(university_name)
     course_ref = Course.get_by_key_name(course_name)
     uni_course_ref = db.GqlQuery(
         "SELECT * FROM UniversityCourse WHERE " + "university = :1 AND " + "course = :2", university_ref, course_ref
     )
     db.delete(uni_course_ref)
Пример #3
0
    def add_course(university_name, course_name):
        """
        Link a university and a course
        """
        from lib.UniversityCourse import UniversityCourse

        university_ref = University.get_by_key_name(university_name)
        course_ref = Course.get_by_key_name(course_name)
        new_university_course = UniversityCourse(university=university_ref, course=course_ref)
        new_university_course.put()
Пример #4
0
 def add_course(university_name, course_name):
     """
     Link a university and a course
     """
     from lib.UniversityCourse import UniversityCourse
     university_ref = University.get_by_key_name(university_name)
     course_ref = Course.get_by_key_name(course_name)
     new_university_course = UniversityCourse(university=university_ref,
                                              course=course_ref)
     new_university_course.put()
Пример #5
0
 def add_course(user_email,
                course_name):
     """
     Link a user and a course
     """
     from lib.UserCourse import UserCourse
     user_ref = User.get_by_key_name(user_email)
     course_ref = Course.get_by_key_name(course_name)
     new_user_course = UserCourse(user=user_ref,
                                  course=course_ref)
     new_user_course.put()
Пример #6
0
 def remove_course(user_email, course_name):
     """
     Unlink a user and a course
     """
     user_ref = User.get_by_key_name(user_email)
     course_ref = Course.get_by_key_name(course_name)
     user_course_ref = db.GqlQuery("SELECT * FROM UserCourse WHERE " +\
                                   "user = :1 AND " +\
                                   "course = :2",
                                   user_ref,
                                   course_ref)
     db.delete(user_course_ref)
Пример #7
0
 def remove_course(university_name, course_name):
     """
     Unlink a university and a course
     """
     university_ref = University.get_by_key_name(university_name)
     course_ref = Course.get_by_key_name(course_name)
     uni_course_ref = db.GqlQuery("SELECT * FROM UniversityCourse WHERE " +\
                                  "university = :1 AND " +\
                                  "course = :2",
                                  university_ref,
                                  course_ref)
     db.delete(uni_course_ref)
Пример #8
0
 def remove_course(user_email,
                   course_name):
     """
     Unlink a user and a course
     """
     user_ref = User.get_by_key_name(user_email)
     course_ref = Course.get_by_key_name(course_name)
     user_course_ref = db.GqlQuery("SELECT * FROM UserCourse WHERE " +\
                                   "user = :1 AND " +\
                                   "course = :2",
                                   user_ref,
                                   course_ref)
     db.delete(user_course_ref)