I am new to Python and App Engine (and server!) And I am trying to create a very simple CMS. Each application deployment will have one - and only one - component object created from something like:
class Company(db.Model): name = db.StringPropery() profile = db.TextProperty() addr = db.TextProperty()
I am trying to provide a tool for updating company profile and other details.
My first thought was that the company was Single Single. But having looked (though far from completely understood) this topic I get the impression that it is difficult and inappropriate to do this.
So, I thought that perhaps for every CMS deployment, I could run a script (called by an absolutely obscure URL) as a one-time, which just creates a company. From now on, I would get this instance with theCompany = Company.all()[0]
Is it possible?
Then I remembered that someone from this thread suggested just using a module. So I just created the Company.py file and fixed several variables in it. I tried this in the SDK and it seems to work - to my surprise, the changed values ββof the variables "survived" between requests.
Forgive my ignorance, but I suppose these values ββare only stored in memory, not on disks - like Datastore stuff? Is this a reliable solution? (And will the module variables have access to all the calls to my application scripts?)
source share