I’m trying to select all objects in the articles table, and have them grouped by their date. I’m thinking it would look similar to this:
articles = Article.objects.filter(pub_date__lte=datetime.date.today()).group_by(pub_date.day)
articles = {'2010-01-01': (articleA, articleB, articleC...),
'2010-01-02': (article1, article2, article3...)...}
Here’s a working example of ignacio’s suggestion to use
itertools.groupby.Output: