python - Dynamic class mixin in Django Views -


i have class based view need inherit class if site setting set true. i've done fair bit of googling on python dynamic inheritance haven't found understand or seemed appropriate. fyi: python knowledge far extensive un-pythonic thing know.

here pseudocode outline mean:

class myview(view):         if settings.implements_activity:         set myview implements activity 

i hope helps explain mean. maybe point me in right direction?

class view1(view):     pass  class view2(view1):            def sepcific_view2_activity(self):        pass    if settings.implements_activity:   myview = view1 else:   myview = view2 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -