【发布时间】:2018-10-06 05:19:18
【问题描述】:
在这种情况下,我尝试将列表视图上下文 (book_list) 同时发送到多个模板。
我尝试通过这样做来编辑模板名称:
class BookListView(ListView):
model = Book
def get_template_names(self):
template_name=["catalog/index.html","catalog/book_list.html"]
return template_name
但是 book_list 仍然只有 catalog/book_list.html 知道而不是 catalog/index.html(所以我添加的函数没有做任何事情)。
有什么建议吗?
最好的问候
【问题讨论】:
标签: django django-generic-views