Why not save it to session then?
Why not use memcache?
Isnt static classes for that? if you run it at the start it will run once
for all users and you can call it over and over with the same return. no?

http://en.wikipedia.org/wiki/Singleton_pattern

-
Cheers,

def AlonCarmel(request)
     import simplejson as json
     contact = {}
     contant['email'] = 'a...@aloncarmel.me'
     contact['twitter'] = '@aloncarmel'
     contact['web'] = 'http://aloncarmel.me'
     contact['phone'] = '+972-54-4860380'
     return HttpResponse(json.dumps(contact))

* If you received an unsolicited email from by mistake that wasn't of your
matter please delete immediately. All E-mail sent from Alon Carmel is
copyrighted to Alon Carmel 2008. Any details revealed in e-mails sent by
Alon Carmel are owned by the Author only. Any attempt to duplicate or
imitate any of the Content is prohibited under copyright law 2008.



On Thu, Jul 29, 2010 at 11:19 AM, Bill Edwards <twmaf...@gmail.com> wrote:

> Hey guys,
>
> Is it horrible to use global variables?  I am currently executing a
> query at the beginning of my handler and storing the query result
> within class object A.  I subsequently need to access the query result
> within multiple different class objects, say B, C, and D.  It has been
> recommended to me to cache object A in the request object, but i need
> to access the variable from within various class objects, so I'm
> finding that I have to pass the object A in to the constructor for
> every new object i define, and then sync any changed state of object A
> with the handler's version of object A when the various class object
> functions are completed.
>
> So it really seems like the simplest way to do things is to just
> define a global variable.  Is there a better option?  Can I think I
> would ideally want to create something liek a session object to store
> the global object.
>
> Thanks!
> Bill
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to