code: def delete(self, *args, **kwargs):
          
          # XXX: circular import
          from fields import RatingField
  
          qs = self.distinct().values_list('content_type', 'object_id').order_by('content_type')
      
          to_update = []
          for content_type, objects in itertools.groupby(qs, key=lambda x: x[0]):
              model_class = ContentType.objects.get(pk=content_type).model_class()
              if model_class:
                  to_update.extend(list(model_class.objects.filter(pk__in=list(objects)[0])))
          
          retval = super(VoteQuerySet, self).delete(*args, **kwargs)
          
          # TODO: this could be improved
          for obj in to_update:
              for field in getattr(obj, '_djangoratings', []):
                  getattr(obj, field.name)._update(commit=False)
              obj.save()
          
          return retval
docs: Handles updating the related `votes` and `score` fields attached to the model.