title: When I tried to sort a list, I got an error 'dict' object has no attribute
body: <p>My code which created the list is:</p>
  
  <pre><code>choices = []
  for bet in Bet.objects.all():
      #...
      #Here is code that skip loop if bet.choice exist in choices[]
      #...
      temp = {
          'choice':bet.choice,
          'amount':bet.sum,
          'count':bets.filter(choice=bet.choice).count()}
      choices.append(temp)
  
  choices.sort(key=attrgetter('choice'), reverse=True)
  choices.sort(key=attrgetter('amount'), reverse=True)
  choices.sort(key=attrgetter('count'), reverse=True)
  </code></pre>
  
  <p>I have to sort by list because model orderby() cant sort by count(),can it?</p>