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

Posted 北门吹雪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TypeError: super(type, obj): obj must be an instance or subtype of type相关的知识,希望对你有一定的参考价值。

问题:

  qs = super(BnnerCourseAdmin, self).queryset()

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

出现问题原因:

  在类的继承时候,super方法继承时间,BnnerCourseAdmin名字并不是本类名字可能是父类名字,需要把名字改成本类名字

那,如何解决?

  把 BnnerCourseAdmin名字改写成 定义supper类的本名,而不是父类名字

以上是关于TypeError: super(type, obj): obj must be an instance or subtype of type的主要内容,如果未能解决你的问题,请参考以下文章