Activate Inherit Function Django

[Solved] Activate Inherit Function Django | Python Frameworks Django - Code Explorer | www.yomemimo.com
Question : activate inherit function django

Answered by : shovi

# Use the super() function to accessing inherited methods that have been overridden in a class.:
class Foo(Bar): def baz(self, arg): return super().baz(arg)
#For Python < 3, you must explicitly opt in to using new-style classes and use:
class Foo(Bar): def baz(self, arg): return super(Foo, self).baz(arg)

Source : https://stackoverflow.com/questions/805066/how-do-i-call-a-parent-classs-method-from-a-child-class-in-python | Last Update : Mon, 30 Aug 21

Answers related to activate inherit function django

Code Explorer Popular Question For Python Frameworks Django