I am developing a application in Django. I am new to python and facing a issue while calling a super call method from a subclass. I am using Python 3.
This is my sunclass :
class TestClass(BaseController):
def try_base(request: HttpRequest):
return super().send_response(200, "", "", model1())
And this is my super class
class BaseController:
def convert_to_dict(obj):
return obj.__dict__
def send_response(self, http_status, error_code, error_message, response_object):
obj = BaseResponse(http_status, error_code, error_message, response_object)
data = json.dumps(obj, default=convert_to_dict, indent=4)
return HttpResponse(data)
I don't know what exactly the problem. It always gives me an error
super(type, obj): obj must be an instance or subtype of type
Please help me in resolving this.