I have a list and I am appending a dictionary to it as I loop through my data…and I would like to sort by one of the dictionary keys.
ex:
data = 'data from database' list = [] for x in data: dict = {'title':title, 'date': x.created_on} list.append(dict)
I want to sort the list in reverse order by value of ‘date’
You can do it this way: