1

I was wondering if it is possible/allowed to share an entity's between two apps, such that one app creates and stores then entity, then the second get's a key from the first one and can then access that entity? Does Second.py need to have the Ent class information in it, or does it just know everything about Ent just by having the object?

First.py:

class Ent(db.model):
    def stuff():
        print "I belong to first"
class out(webapp2.RequestHandler):
    def get():
        e = Ent()
        key = e.put()
        return key

Second.py:

class in(webapp2.RequestHandler): 
    response = urllib2.urlopen(urlOfFirstApp)
    ent = #access BigTable with response/key, I'm not sure how to do this or if I can or if I'm allowed to
    ent.stuff()
EasilyBaffled
  • 3,822
  • 10
  • 50
  • 87

1 Answers1

0

It depends on where your data is stored. If it is stored in the GAE datastore, it can only be stored in the datastore for one app, and would have to be accessed over some kind of HTTP API by the other. If, however, it is stored in something like Google Cloud Storage, you can (I think) share identifiers and access from multiple apps.

Linuxios
  • 34,849
  • 13
  • 91
  • 116
  • I never realized there was a difference, I thought that the GAE datastore was BigTable and was just shared by everything. – EasilyBaffled Jun 27 '13 at 14:04
  • @EasilyBaffled: Think of how disastrous that would be.Anyone could just brute force the keys or ids and access other peoples data. Also, see [this](http://stackoverflow.com/questions/8956230/can-i-access-datastore-entities-of-my-other-google-app-engine-applications) question. – Linuxios Jun 27 '13 at 14:06