更新时间:2023-12-02 23:23:10
然后您要说的是将appname.modelname传递给模板标签,实际上应该将模型的实例传递给模板标签,例如:
What you are saying then is that you pass appname.modelname to the template tag, you should actually pass an instance of the model to the template tag something like:
{% render_comment_list for publisher %}
如果发布者是发布者模型的实例,因为它看起来像在您的代码中一样.或者:
if publisher is an instance of the Publisher model as it looks to be in your code. Or alternatively:
{% render_comment_list for books.publisher publisher.id %}
就像上面提到的psjinx.
as psjinx mentioned above.