Thank you! Nicks article was very useful On Jun 3, 4:37 pm, djidjadji <[email protected]> wrote: > Why not denormalize the model and put just StringProperties in the > class Employee? > > You could give the Type and Status key names that are the same as the > name property. > You can then get the name with > > emp = Employee.all().get() > typeName = Employee.type.get_value_from_datastore(emp).name() > > Or use the method in Nicks article > > http://blog.notdot.net/2010/01/ReferenceProperty-prefetching-in-App-E... > > 2010/6/3 ae <[email protected]>: > > > If I have a data model like this... > > > class Type(db.Model): > > name = db.StringProperty() > > > class Status(db.Model): > > name = db.StringProperty() > > > class Employee(db.Model): > > name = db.StringProperty() > > type = db.ReferenceProperty(Type) > > status = db.ReferenceProperty(Status) > > > ... and I want to display a list of employees along with type.name and > > status.name > > the performance seems to be really impacted by the number of employees > > because I'm making 2 X (no. of employees) datastore API calls. (e.g. > > for 100 employees, I'm making 200 datastore API calls) > > > my question is how can I improve this without limiting the number of > > employees I display or flattening my data model? > > > -- > > 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 > > athttp://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 [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.
