0

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.

4

1 回答 1

1

哦,在这里。

@jinja2.contextfunction
def paginate(context):
    pass
于 2009-12-12T09:17:29.897 回答