django - convert a list back to a queryset [duplicate]
问题 This question already has answers here : A QuerySet by aggregate field value (3 answers) Closed 5 years ago . I have a handful of records that I would like to sort based on a computed value. Got the answer over here... like so: sorted(Profile.objects.all(), key=lambda p: p.reputation) on a Profile class like this: class Profile(models.Model): ... @property def reputation(self): ... Unfortunately the generic view is expecting a queryset object and throws an error if I give it a list. Is there