I have a few models that need the same change permissions logic, i.e.
the same can_change() implementation.

If I implement can_change() in a common superclass, it does not work
(permissions are not applied):

class Common(Ownable):
    # some common attributes
    ...

    def can_change(self, request):
        ...

class Model1(MezzaninePage, Common):
    ...

Is there a reason for this not to work? What’t the best way to use the
same can_change() in multiple models/

________________________________

PS. To stay DRY, this is how I’m working around this:

def _can_change_method(self, reqeust):
    ...

class Model1(MezzaninePage, Common):
    ...
    can_change = _can_change_method

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to