How can i sort this dict per datetime?
Is it possible?
{
1: {'l':{'created_on': datetime.datetime(2011, 9, 29, 17, 39, 26)}},
2: {'l':{'created_on': datetime.datetime(2011, 9, 23, 17, 39, 26)}},
3: {'l':{'created_on': datetime.datetime(2011, 9, 30, 17, 39, 26)}}
}
You can call the sorted() function on the values, with the datetime as the comparison key: