您应该
super使用
UrlManager类作为第一个参数而不是
URL模型来调用。
super不能使用不 相关的 类/类型进行调用:
从文档中
super(type[, object-or-type]):返回将方法调用委托给类型的父级或同级类的代理对象。
因此,您 无法 执行以下操作:
>>> class D:... pass... >>> class C:... def __init__(self):... super(D, self).__init__()... >>> C()Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in __init__TypeError: super(type, obj): obj must be an instance or subtype of type
你应该做:
qs_main = super(UrlManager, self).all(*args, **kwargs)
或在Python 3中:
qs_main = super().all(*args, **kwargs)



