[Answer]-How group by date in Django

1👍

You could try itertools.groupby, but careful as Django might cache the generator as a list and consume it.

from itertools import groupby
groupby(orders, lambda order : order.date.month)
👤C.B.

Leave a comment