This one time, at band camp, Jamie Wilkinson wrote:
>Anyway, the workaround to this was to copy the two lines that set up the
>engine from BaseController.__call__() and put them in
>SecurityController.__before__, which PylonsBaseSecureController.__call__
>hooks before it runs.
>
>This feels hackish, because now I have duplicated code, and if I want to
>change the way the engine gets set up, now I have to remember to change it
>in more than one place.

> * Should BaseController implement __before__ and pylons.Controller be
>modified to support this __before__ hook?  (It may already, I havne't
>looked as it only just occurred to me).  This would probably be easier to
>implement.

Turns out pylons.Controller does in fact use __before__, so I removed
__call__ from my BaseController and put all that code in __before__.

Now my SecurityController inherits from both AuthKit's
PylonsSecureController and my standard BaseController, and everything's
happy.

Can I suggest the Pylons template be changed to rename __call__ to
__before__?  If the sole purpose of the class is to let people "Insert any
code to be run per request" then __before__ sounds like a much neater place
to put that code.

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to