Thanks Max,
seems like it makes sense to put it to global scope this way and
configure programmaticaly. Just used to configure everything with XML,
but programmatic object configuration with python seems to be less
verbose than with Java.

m

On Sep 2, 4:01 pm, "Max Ischenko" <[EMAIL PROTECTED]> wrote:
> On 9/1/07, mickolka <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all
> > I want to write a FileStorage service object with following features
> > - should be configured on the start of the application
> > - should be accessible from the any controller
> > - have only one instance
>
> Pylons provide a `g` namespace for your application "globals":
>
> class Globals(object):
>     def __init__(self):
>         self.fs = MySuperService()
>
> ... controller.html:
>
> <% g.fs.supermethod() %>
>
> Check the docs or search through Pylons cookbook, there is probably a recipe
> for this.
>
> Max.


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to