当我从db获取它时,如何对列表'articles_list'进行排序?
def article_theme(request, articleblock_id=2):
return render_to_response('article_theme.html',
{"ArticleBlock_name": ArticleBlock.objects.get(id=articleblock_id),
'articles_list': Articles.objects.filter
(articles_articleblock_id=articleblock_id)})
答案 0 :(得分:1)
这是:
Articles.objects.filter(articles_articleblock_id=articleblock_id).order_by('?')