私はこのロジックを実行しようとしています:
1. take all objects
2. filter them: all objs which has rate value >= 4
3. then take randomly 4 out of them.
その中からランダムに4つ取るにはどうすればいいですか?端から切るだけでなく
これは私のコードです:
MyObj.objects.filter(objects__rate__gte=4).distinct('id').order_by('-id')[:4]