8 Nov
2002
8 Nov
'02
10:11 p.m.
Jim Kutter writes:
I have a product with a class that contains a DateTime object with the name datetime (I know, bad choice, but the choice has been made...)
So I want to sort a collection of these objects by ascending date. So I get all objects of that type into a list called "events" then use the sequence module
So this is my basic logic - sorted = sequence.sort(events, (('datetime.x()', 'cmp', 'asc'),)) ^^^^^^^^^^^^ This must be the name of an attribute or parameterless method, not the method call itself. Use "x" alone.
Dieter