SZanlongo
7/9/2015 - 2:13 PM

Sort list of Objects From: http://stackoverflow.com/questions/1516249/python-list-sorting-with-multiple-attributes-and-mixed-order

class temp:
    def __init__(self, t1, t2, t3):
        self.t1 = t1
        self.t2 = t2
        self.t3 = t3
    def __str__(self):
        print self.t1, self.t2, self.t3
    def __repr__(self):
        return str(self.t1) + str(self.t2) + str(self.t3)

def mixed_order(a):
    return (a.t1[0], a.t1[1], a.t1[2], a.t2, a.t3)

someList = [temp([3, 3, 3], 2, 3), temp([1, 2, 3], 2, 1), temp([3, 2, 1], 3, 1), temp([1, 1, 1], 3, 2)]
print someList

someList.sort(key=mixed_order)
print someList