if len(tokens) == 3:
    return cls(queryset=parser.compile_filter(tokens[2]), template=template)
else:
    raise template.TemplateSyntaxError('%r tag requires 2 arguments' %
        tokens[0])

def __init__(self, queryset=None, template=None):
    self.queryset = queryset
self.template = template

def render(self, context):
    return render_to_string(self.template, {'queryset': self.queryset})
How do I pass a lot of parameters to views in Django?