0

I am using the include template tag inside a template of a class based generic view and I need to append a custom path created with the current model system name to the list of templates that Django is going to check looking for the included template.

I am trying to create a custom template loader, but it needs to access to the view, the request or the context in order to get the model, and I haven't found the way of reach this.

How do I do it?

4

1 回答 1

0

如果我正确理解了您的问题,您可能会发现包含标记很有用——只需将装饰器的takes_context参数设置为True.

于 2012-03-30T10:25:53.093 回答