Thanks so much for the confirmation.   I figured that I would get this
kind of functionality (ala Globals); logically this made sense; so
thanks for confirming what isn't super clear.

Cheers,
John

On Oct 18, 5:03 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> John Lorance schrieb:
>
> > Here's what I am wanting to do.
>
> > - When I create my widgets, I want to assign a special attribute like
> > "handler=SomeObject.someClassMethod" which gets assigned to a list or
> > dict that then is available to the controller for the next page
> > request so I can write a very generic form/request/event handler.
>
> > So, I have this working well... however, my two questions are:
> > 1. I can store this information in a globally defined list or dict and
> > I find that it does persist between browser requests... I would have
> > figured that it would be re-initialized every time.   So, can a TG
> > application, once loaded via CherryPy, maintain a persistent or static
> > set of globals as I am seeing here? or am I seeing something that is
> > more a bug and not a feature?
>
> Yes, it can maintian globals.
>
> > 2. If #1 is yes, is this safe?
>
> I'm unclear on what you want here. If it's static information that
> doesn't depend on user input, it's safe.
>
> > 3. Lastly, since my method basically creates a dictionary or list in
> > which the data is a pointer to a method defined as a classmethod..
> > does this value change or vary from user to user, request to request?
> > I'm going to assume no for now.
>
> > Has anyone done anything like this in TG with globals?   I would
> > prefer not to store this information in the user session since it
> > seems rather strange to store pointers to methods in such a place...
> > and might be a bad idea to do so.
>
> See above - if it's static information, it's perfectly alright to do so.
>
> DIZE


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to