'Sort query using this column.'

def sort(self, trans, query, ascending, column_name=None):

    if (column_name is None):
        column_name = self.key
    if ascending:
        query = query.order_by(self.model_class.table.c.get(column_name).asc())
    else:
        query = query.order_by(self.model_class.table.c.get(column_name).desc())
    return query
