I’ve a query like this:
Listing.objects.all().order_by('-premium', 'title')
It works like expected, returns all premium classes first and then everything ordered by title.
Now I need to randomize only the order of the premium results. Is that possible?
Ok, I think there’s no solution in a single query.
So I’ve solved this using two queries:
Note: I needed a list as output, otherwise you can combine queries results using Django’s
Qobject.