Can i sort query set return objects in order to function result
问题 I am writing a web based music application and I want implement some feature that user can see most favor album in last week-month-year. so this is my model : class album(models.Model): def get_weely_count(): ... def get_monthly_count(): ... def get_yearly_count(): ... class like(models.Model): created_at = models.DateField() albumID = models.ForeignKey(Album) Now I want to receive albums that most liked in last week or last month or last year,I want done some thing like this(but I can not):