【发布时间】:2020-05-13 18:31:39
【问题描述】:
我想在方法 'as_view()' 中添加我自己的属性 'fileName'
path('dialogs/', CodeResponseView.as_view(fileName='Dialogs.py')),
Django 给了我一个arror:
TypeError: CodeResponseView() received an invalid keyword 'fileName'. as_view only accepts arguments that are already attributes of the class.
【问题讨论】:
-
CodeResponseView是如何定义的?它继承自什么? -
是的,对不起,我在那里找到了答案 stackoverflow.com/questions/11494483/… 。谢谢纳林
标签: django