Django somehow cannot determine simple annotate function
问题 I'm trying to create an annotation on a queryset class that simply adds a boolean that is the result of some standard queries. CustomQueryset(models.QuerySet): """ An extension of the traditional queryset to support filtering on accepting_offers """ def annotate_with_accepting_offers(self): """ Add a lovely little variable to the SELECT that says if the listing is accepting offers. A <thing> is accepting offers when its: + not cancelled + expire date is today or in the future + has spaces