title: Django: unhashable type: 'list'
body: <p>My snippet from my function,</p>
  
  <p>it just fetches from as django queryset objects and converting into list to remove duplicates using itemgetter and itertools method like <a href="https://stackoverflow.com/questions/7090758/python-remove-duplicate-dictionaries-from-a-list/7091256#7091256">python remove duplicate dictionaries from a list</a></p>
  
  <pre><code>   hc = HomeContractorDetails.objects.filter(category=domain_obj.category,city__icontains=domain_obj.city).values(*args)
      _arg = list(args)
      _arg.remove('id')
      hc = list(hc)
      print _arg,hc
  
      n= hc.sort(key=operator.itemgetter(_arg))
  </code></pre>
  
  <p>ERROR FOR THE ABOVE STMT</p>
  
  <pre><code>['con_name', 'rating', 'review_no'] [{'rating': u'4.32', 'review_no': u'51', 'id': 3781, 'con_name': u"Carter's Mechanical, Inc."}, {'rating': u'4.02', 'review_no': u'29', 'id': 3782, 'con_name': u'All Mechanical Plumbing &amp; Heating, Inc.'}, {'rating': u'4.17', 'review_no': u'5', 'id': 3783, 'con_name': u'Marcelo Construction'}, {'rating': u'4.63', 'review_no': u'34', 'id': 3784, 'con_name': u'Jay Ell Plumbing and Heating Company, Inc.'}, {'rating': u'4.94', 'review_no': u'24', 'id': 3785, 'con_name': u'Franco Belli Plumbing and Heating and Sons, Inc.'}]
  
  File "/home/gridlex/workspace/HA/article/views.py" in fetch_contractor_tables
        213.     n= hc.sort(key=operator.itemgetter(_arg))
  
      Exception Type: TypeError at /article/top-rated-plumbing-contractors-in-new-york
      Exception Value: unhashable type: 'list'
  </code></pre>
  
  <p>The variable hc prints list of dict values.But I could not able to sort using itemgetter keyfunc.</p>
  
  <p>Could you help me to identify this issue? </p>