def sort(self, request, reverse=False):
        """Sort current collection."""
        field = self.model._meta.fields.get(self.columns_sort)
        if not field:
            return self.collection

        if reverse:
            field = field.desc()

        return self.collection.order_by(field)
def sort ( self , request , reverse = False ) : field = self . model . _meta . fields . get ( self . columns_sort ) if not field : return self . collection if reverse : field = field . desc ( ) return self . collection . order_by ( field )
Sort current collection.