当我调用这个函数时,我试图弄清楚HttpResponseRedirectBase
是如何被调用的
return HttpResponseRedirect(next_page, context)
我相信这个问题与python的关系比Django更大,但是我找不到这个问题的答案是的。所以呢到目前为止,这就是我所看到的
class HttpResponseRedirect(HttpResponseRedirectBase):
status_code = 302
现在我的问题是这里如何调用HttpResponseRedirectBase
的初始值设定项?我试着模拟上述情况
class foo(object) :
def __init__(self,par):
print "Inside foo constructor"
class bar(foo):
status_code = 302
b = bar(23)
我不确定在这种情况下如何调用foo的init?在这种情况下,我得到的错误
Traceback (most recent call last):
File "python", line 5, in <module>
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str
任何帮助解决这个问题都将不胜感激。你知道吗
您正在尝试继承
function
其中
foo
是功能。有吗你是说相关问题 更多 >
编程相关推荐