views:

84

answers:

1

For example, I have an paginator object with a lot of attributes, and don't want do write something like {{ paginate(paginator) }} in templates.

How can a get context automatically in the filter function, like a django register.inclusion_tag(…, takes_context=True)?

Yes, of course, I can do something like paginate(paginator), but it looks weird, imho.

+1  A: 

Oh, here it is.

@jinja2.contextfunction
def paginate(context):
    pass
SvartalF