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
Post a Comment