摘要:
>>> qs=Question.objects.extra(select={'anum': 'SELECT COUNT(*) FROM questions_answer WHERE questions_answer.question_id = questions_question.id'},).extra(order_by=['-anum'])>>> [q.anum for q in qs][3, 3, 3, 3, 2, 2, 1, 1, 1, 0, 0, 0, 0]>>> qs2=Quest 阅读全文