本文整理汇总了Python中models.Topic.query方法的典型用法代码示例。如果您正苦于以下问题:Python Topic.query方法的具体用法?Python Topic.query怎么用?Python Topic.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Topic
的用法示例。
在下文中一共展示了Topic.query方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Topic [as 别名]
# 或者: from models.Topic import query [as 别名]
def get(self):
qry = Topic.query().order(Topic.topic)
topics = []
for row in qry:
likes = Like.query().filter(Like.topic == row.key).count()
topics.append(TOPIC(key=row.key, topic=row.topic, description=row.description, archived=row.archived, likes=likes))
self.render_template('home.html', {'topics': topics})
示例2: flush
# 需要导入模块: from models import Topic [as 别名]
# 或者: from models.Topic import query [as 别名]
def flush():
ndb.delete_multi(School.query().fetch(keys_only=True))
ndb.delete_multi(QuestionInstance.query().fetch(keys_only=True))
ndb.delete_multi(State_Questions.query().fetch(keys_only=True))
ndb.delete_multi(Topic_States.query().fetch(keys_only=True))
ndb.delete_multi(Question.query().fetch(keys_only=True))
ndb.delete_multi(State.query().fetch(keys_only=True))
ndb.delete_multi(Address.query().fetch(keys_only=True))
ndb.delete_multi(Teacher.query().fetch(keys_only=True))
ndb.delete_multi(Class.query().fetch(keys_only=True))
ndb.delete_multi(Assessment_Record.query().fetch(keys_only=True))
ndb.delete_multi(Student.query().fetch(keys_only=True))
ndb.delete_multi(UserInfo.query().fetch(keys_only=True))
ndb.delete_multi(Student_Assessments.query().fetch(keys_only=True))
ndb.delete_multi(Assessment.query().fetch(keys_only=True))
ndb.delete_multi(Subject.query().fetch(keys_only=True))
ndb.delete_multi(Topic_Questions.query().fetch(keys_only=True))
ndb.delete_multi(State_Questions.query().fetch(keys_only=True))
ndb.delete_multi(Topic_States.query().fetch(keys_only=True))
ndb.delete_multi(Subject_Topics.query().fetch(keys_only=True))
ndb.delete_multi(Student_Assessments.query().fetch(keys_only=True))
ndb.delete_multi(Topic.query().fetch(keys_only=True))
ndb.delete_multi(User.query().fetch(keys_only=True))
ndb.delete_multi(Assessment_Record.query().fetch(keys_only=True))
ndb.delete_multi(State_Types.query().fetch(keys_only=True))