本文整理汇总了Python中models.Question.get_question_count方法的典型用法代码示例。如果您正苦于以下问题:Python Question.get_question_count方法的具体用法?Python Question.get_question_count怎么用?Python Question.get_question_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Question
的用法示例。
在下文中一共展示了Question.get_question_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: store_question
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_question_count [as 别名]
def store_question(store_id):
db = g._imdb
offset = int(request.args.get('offset', 0))
limit = int(request.args.get('limit', 10))
rows_found = Question.get_question_count(db, store_id)
sellers = Question.get_page_question(db, store_id, offset, limit)
store_info = Store.get_store(db, store_id)
g.pagination.setdefault()
g.pagination.rows_found = rows_found
g.pagination.limit = limit
g.pagination.offset = offset
return render_template('store/question.html',
data={'offset': offset,
'list': sellers,
'store_info': store_info,
'pagination': g.pagination,
})
示例2: question_index
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_question_count [as 别名]
def question_index():
db = g._imdb
uid = session['user']['id']
store_id = session['user']['store_id']
offset = int(request.args.get('offset', 0))
limit = int(request.args.get('limit', 10))
rows_found = Question.get_question_count(db, store_id)
questions = Question.get_page_question(db, store_id, offset, limit)
g.pagination.setdefault()
g.pagination.rows_found = rows_found
g.pagination.limit = limit
g.pagination.offset = offset
return render_template('question/question.html',
data={'offset': offset,
'list': questions,
'pagination': g.pagination,
})