Closed kitsunde closed 11 years ago
If they don't want to inherit off something they'd just not?
The pattern for the actual views are to take all functionality people might want somewhere else and then integrate that through a mixin.
So you should change the logic in FacebookPostAsGetMixin to match what you want and then inherit from that in your view.
So basically all views should be a collection of mixins that do all the work, when you're building generic views.
You are right, I should just change the mixin and inherit off that to the FacebookEnabledTemplateView. I was confused on how python inheritance works when one inherited thing calls super(), it appears it'll cascade to the method of the next inherited thing. Like:
class Foo(object):
def bar(self):
print "Foo"
class BazMixin(object):
def bar(self):
super(BazMixin, self).bar()
print "BazAlso"
class Bar(BazMixin, Foo):
pass
Bar().bar()
Foo
BazAlso
FacebookPostAsGetMixin
overrides every POST instead ofFacebookEnabledTemplateView
that only does it when asigned_request
has been decoded. I don't it's possible to get it to stop doing that in a mixin since we would need to overridedef post
. It would probably be possible write a decorator for classes that doesn't want to inherit offFacebookEnabledTemplateView
(or similar) though. ping @gaqzi