[Django]-Django list ordering by date

3👍

You may try to chain 2 querysets together and the apply sorted to them:

from itertools import chain
from operator import attrgetter

articles = list(Articles.objects.all())

statut = list(Statut.objects.all())

result_list = sorted(
    chain(articles, statut),
    key=attrgetter('date_created')) # date_created name may differ
👤pythad

0👍

Hmm…, my suggestion is sorting them on front-end with some js framework, e.g., jquery.

Leave a comment