[Answer]-Add an element of randomness to ordering in SQL, django

1👍

There is a random ordering built into .order_by() using the string '?':

https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.order_by

In your case it would be:

Article.objects.order_by('?')

After ordering them, you might then filter out the top X records and again order them by rating.

👤G Rice

Leave a comment