當前位置: 首頁>>代碼示例>>Python>>正文


Python Course.gql方法代碼示例

本文整理匯總了Python中models.Course.gql方法的典型用法代碼示例。如果您正苦於以下問題:Python Course.gql方法的具體用法?Python Course.gql怎麽用?Python Course.gql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models.Course的用法示例。


在下文中一共展示了Course.gql方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get

# 需要導入模塊: from models import Course [as 別名]
# 或者: from models.Course import gql [as 別名]
    def get(self):
        course_list = {}
        my_courses = {}
        user = self.get_user()
        my_courses = UserCourse.gql('WHERE user=:1',user['user'])
        course_list = Course.gql('ORDER BY course').fetch(50)

        self.render('signup-2.html',my_courses=my_courses,course_list=course_list)
開發者ID:BeyondeLabs,項目名稱:quizer,代碼行數:10,代碼來源:profile.py

示例2: get

# 需要導入模塊: from models import Course [as 別名]
# 或者: from models.Course import gql [as 別名]
 def get(self):
     class_list = {}
     course_list = {}
     my_courses = {}
     user = self.get_user()
     if not hasattr(user['user'], "name"):
         self.redirect('/home')
     else:
         if user['user'].type=='Student':
             class_list = ClassStudent.gql('WHERE student=:1',user['user'])
         else:
             class_list = LectClass.gql('WHERE lecturer=:1',user['user'])
         my_courses = UserCourse.gql('WHERE user=:1',user['user'])
         course_list = Course.gql('ORDER BY course').fetch(50)
     self.render('base.html',class_list=class_list,course_list=course_list,my_courses=my_courses)
開發者ID:BeyondeLabs,項目名稱:quizer,代碼行數:17,代碼來源:script.py

示例3: get

# 需要導入模塊: from models import Course [as 別名]
# 或者: from models.Course import gql [as 別名]
 def get(self):
     from models import MajorRequirements, Course
     filename = 'resources/cmps_major.txt'
     file = open(filename)
     major = 'CMPS'
     db.delete(MajorRequirements.all())
     skip_flag = False
     for line in file.readlines():
         if line[0] == '\n': continue
         if line[0] == '#': continue
         if line[0] == '-': skip_flag = True;
         if skip_flag == True:
             skip_flag = False
             continue
         course = Course.gql("WHERE number='{}'".format(line.strip())).get()
         if course == None: continue
         requirement = MajorRequirements(major=major, course=course)
         requirement.put()
     requirements = MajorRequirements.all().fetch(limit=100)
     self.response.write('<br><br>'.join(map(repr, requirements)))
開發者ID:sampwing,項目名稱:cmpe231_project,代碼行數:22,代碼來源:main.py

示例4: forum_category_page

# 需要導入模塊: from models import Course [as 別名]
# 或者: from models.Course import gql [as 別名]
def forum_category_page(request, tag, page):
  discussions=Course.gql("WHERE ANCESTOR IS :1", tag)
  tags=Tag.gql("WHERE depth = :1", 100)
  return render_to_response('tasteofhome/forum_category.html', {'discussions': discussions, 'category':tag, 'categories': forum_categories()})
開發者ID:motord,項目名稱:Taste,代碼行數:6,代碼來源:views.py

示例5: post

# 需要導入模塊: from models import Course [as 別名]
# 或者: from models.Course import gql [as 別名]
 def post(self):
     from models import Prerequisites, Course
     course = Course.gql("WHERE number='{}'".format(self.request.get('course'))).get()
     prereq = Course.gql("WHERE number='{}'".format(self.request.get('prerequisite'))).get()
     p = Prerequisites(course=course, prereq=prereq)
     p.put()
開發者ID:sampwing,項目名稱:cmpe231_project,代碼行數:8,代碼來源:main.py


注:本文中的models.Course.gql方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。