python - Django random sort list -


how can sort rundom list 'articles_list' when db?

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)}) 

here is:

articles.objects.filter(articles_articleblock_id=articleblock_id).order_by('?') 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -