'Sort column using case-insensitive alphabetical sorting.'

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

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