Ordering a Django QuerySet by a datetime's month/day?
问题 I have a list of people, each person having a birthdate, which is predictably stored in a DateField . I'm trying to create a list of those people—sorted by the month and day of their birth (disregarding the year)—to have a sort of "who's birthday is coming up" display. I can't seem to order a QuerySet by the person's datetime.month value. Is there any way that this could be done without having to resort to coercing to a list() ? Thanks in advance and please let me know if the question needs