I work on a small Django app and get an error tells me, super(type, obj): obj must be an instance or subtype of type. I get it from the view
You should call super using the UrlManager class as first argument not the URL model. super cannot called be with an unrelated class/type:
From the docs,
super(type[, object-or-type]): Return a proxy object that delegates method calls to a parent or sibling class of type.
So you cannot do:
>>> class D:
... pass
...
>>> class C:
... def __init__(self):
... super(D, self).__init__()
...
>>> C()
Traceback (most recent call last):
File "", line 1, in
File "", line 3, in __init__
TypeError: super(type, obj): obj must be an instance or subtype of type
You should do:
qs_main = super(UrlManager, self).all(*args, **kwargs)
Or in Python 3:
qs_main = super().all(*args, **kwargs)