On Jun 30, 2006, at 8:59 AM, askel wrote:

> Thank you for quick answer. As far as I understand, controllers
> directory will be re-scanned every time this function is called thus if
> I want to use controller list in every request it will significally
> increase down response time.
>
> Assuming I don't change mapping anywhere beside routing.py, would it
> work if I use the following approach:
>
> # app_globals.py
> import pylons.middleware
>
> class Globals(pylons.middleware.Globals):
>  def __init__(self, global_conf, app_conf, **extra):
>   self.controllers = your_way_of_getting_controllers()

Yup, you're assumption is correct that it will re-scan the controllers 
dir every time. Keeping the value in the global object is the best 
option as you highlight is the best option. You can then just use 
g.controllers.

Cheers,
Ben


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to