Sort function for object by created date

def _sortByCreated(a, b):
    """Sort function for object by created date"""
    if a.created < b.created:
        return 1
    elif a.created > b.created:
        return -1
    else:
        return 0