title: django - convert a list back to a queryset
body: <p>I have a handful of records that I would like to sort based on a computed value. Got the answer <a href="https://stackoverflow.com/questions/930865">over here</a>... like so:</p>
  
  <pre><code>sorted(Profile.objects.all(), key=lambda p: p.reputation)
  </code></pre>
  
  <p>on a Profile class like this:</p>
  
  <pre><code>class Profile(models.Model):
  
      ...
  
      @property
      def reputation(self):
          ...
  </code></pre>
  
  <p>Unfortunately the generic view is expecting a queryset object and throws an error if I give it a list. </p>
  
  <p><strong>Is there a way to do this that returns a queryset</strong></p>
  
  <p>or...</p>
  
  <p><strong>Can I convert a list to a queryset somehow?</strong> Couldn't find anything like that in the django docs.</p>
  
  <p>I am hoping not to denormalize the data, but I guess I will if I have to.</p>
  
  <h1>Update / Answer:</h1>
  
  <p>it seems that the only way to get a queryset back is if you can get all of your logic into the sql queries. </p>
  
  <p>When that is not possible, (I think) you need to denormalize the data</p>