It appears as if this is occurring when I'm not importing the Comment model. This might be mentioned in the docs, but I've been developing with GAE for a while and didn't know that it was necessary to import the model of the referred entity kind.
On Feb 1, 2:23 am, James <[email protected]> wrote: > Let's use a simple example of a model containing posts and comments. > The comment model contains a ReferenceProperty to Post, with a > "comments" collection name. > > It always works fine locally: > > # Let's build a query object: > from model import Post > p = Post.all().get() > p.comments>> <google.appengine.ext.db.Query object at 0xcb27cac> > > # Now we can fetch a list of comment entities. > > Sometimes, it works correctly on production. But sometimes, this > happens: > > # Let's build a query object: > from model import Post > p = Post.all().get() > p.comments > > >> AttributeError: 'Post' object has no attribute 'comments' > > And this is for entities where I've double and triple checked the > model and the existence of the reference data. This problem didn't > exist for me unitl a few days ago, either. > > I suspect this could be an index.yaml issue, but I use the - > require_indexes dev_appserver param, and I've double-checked my index. > > Please, please do suggest something if you know the answer. This is a > nasty bug, and I have no idea where it's coming from. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
