Suppose I have the following database:
class Model1(db.Model):
att1 = db.IntegerProperty()
class Model2(db.Model):
model1 = db.ReferenceProperty(Model1, collection_name='model2s')
string = db.StringProperty()
Suppose I create a few Model1s and several Model2s, then have the
following code:
model1s = Model1.all()
for model1 in model1s:
for model2 in model1.model2s:
self.response.out.write(model2.string)
Does model1.model2s cause a query to be run? I would imagine so. Is
this query run every time I ask for model1.model2s, or is it
automatically cached?
Any information on this would be helpful.
Thanks,
Paddy Foran
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---