本文整理汇总了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)
示例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)
示例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)))
示例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()})
示例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()