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 = \
If you're into the whole brevity thing:
data = "data from database" sorted_data = sorted( [{'title': x.title, 'date': x.created_on} for x in data], key=operator.itemgetter('date'), reverse=True)