Good afternoon, the essence of the problem is this: there are 2 types of models - let it be A and B. There are samples for them, i.e.
a = A.objects.filter(parameters) b = B.objects.filter(parameters)
Required: you need to get one array of these 2 samples (ie, you need to "glue" them), sorted by a specific field (let there be a 'date' field). After concatenation, the unsorted array is obtained. Sorting by type (man):
sorted(result, key=operator.attrgetter('date')) sorted(result, key=lambda item: item.date)
do not lead to anything, the data still remain unsorted. Knowing people, tell me where I have a mistake?