'Returns the filterset class to use in this view'

def get_filterset_class(self):

    if self.filterset_class:
        return self.filterset_class
    elif self.model:
        return filterset_factory(model=self.model, fields=self.filter_fields)
    else:
        msg = u"'%s'    must    define    'filterset_class'    or    'model'"
        raise ImproperlyConfigured((msg % self.__class__.__name__))
