On 5/3/07, Ben Bangert <[EMAIL PROTECTED]> wrote: > > The WSGIController (that BaseController inherits from) will actually > run your __before__ methods, putting code in __call__ means you can > load even before that. Perhaps you have code that has to run before > some inherited controllers __before__ method, putting it in __call__ > ensures that its called in advance.
There is a caveat in using methods like __before__. The base class' implementation needs to be called explicitly (as with any super impl). Which means putting "common" logic into BaseController.__before__ poses the threat that subclass may failed to execute it. I am interested in hearing how others deal with this issue. I ended up having an empty __before__ in BaseController, putting "common" logic into BaseController.__call__ and never overriding __call__ in subclasses. Max. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
