'Returns the keyword arguments for instanciating the filterset.'

def get_filterset_kwargs(self, filterset_class):

    kwargs = {u'data': (self.request.GET or None), u'request': self.request}
    try:
        kwargs.update({u'queryset': self.get_queryset()})
    except ImproperlyConfigured:
        if (filterset_class._meta.model is None):
            msg = u"'%s'    does    not    define    a    'model'    and    the    view    '%s'    does    not    return    a    valid    queryset    from    'get_queryset'.        You    must    fix    one    of    them."
            args = (filterset_class.__name__, self.__class__.__name__)
            raise ImproperlyConfigured((msg % args))
    return kwargs
