super(type, obj): obj must be an instance or subtype of type

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 "<stdin>", line 1, in <module>
  File "<stdin>", 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)

Leave a Comment