Hi, One additional question, what happens when you call db.get() on the value returned from dygmodel.ChatWordStats.timespan.get_value_for_datastore(cws)? Does this get the proper entity. I've never seen this before, so I'm not sure what exactly is occurring here.
-Marzia On Sun, Jan 4, 2009 at 9:16 AM, dloomer <dloo...@gmail.com> wrote: > > I worked around that last problem, focused on some other things, but > now I'm running into the issue again. > > Same model definitions as above; now getting the error trying to > reference a StatsTimeSpan property of ChatWordStats. It shouldn't > matter, but for completeness an abbreviated definition of > StatsTimeSpan is as follows: > > class StatsTimeSpan(db.Model): > timespanvalue = db.IntegerProperty() > year_central = db.IntegerProperty() > month_central = db.IntegerProperty() > day_central = db.IntegerProperty() > hour_central = db.IntegerProperty() > postcount = db.IntegerProperty(required=True,default=0) > totalduration = db.FloatProperty(required=True,default=float(0)) > date = db.DateTimeProperty(auto_now_add=True) > > The code raising the error: > > cws = dygmodel.ChatWordStats.get(key_val) > logging.info("cws.key()=" + str(cws.key())) > logging.info > ("dygmodel.ChatWordStats.timespan.get_value_for_datastore > (cws)=" + str(dygmodel.ChatWordStats.timespan.get_value_for_datastore > (cws))) > cws.timespan.key() > > cws.key() is logged as > > ahJkeWluZ2dpcmFmZmVsZWFndWVyLAsSDUNoYXRXb3JkU3RhdHMiGWN3c190c18xXzBfMF8wXzBfY3dfX2FsbF8M. > At > http://appengine.google.com/datastore/edit?app_id= > <myAppID>&key=ahJkeWluZ2dpcmFmZmVsZWFndWVyLAsSDUNoYXRXb3JkU3RhdHMiGWN3c190c18xXzBfMF8wXzBfY3dfX2FsbF8M > this shows a timespan key value of > ahJkeWluZ2dpcmFmZmVsZWFndWVyHwsSDVN0YXRzVGltZVNwYW4iDHRzXzFfMF8wXzBfMAw. > dygmodel.ChatWordStats.timespan.get_value_for_datastore(cws) is logged > as that same key value, > ahJkeWluZ2dpcmFmZmVsZWFndWVyHwsSDVN0YXRzVGltZVNwYW4iDHRzXzFfMF8wXzBfMAw. > That key value resolves fine in DataViewer if I go to > http://appengine.google.com/datastore/edit?app_id= > <myAppId>&key=ahJkeWluZ2dpcmFmZmVsZWFndWVyHwsSDVN0YXRzVGltZVNwYW4iDHRzXzFfMF8wXzBfMAw. > > However, the cws.timespan.key() line, or any alternative code trying > to reference a property of cws.timespan, throws the "ReferenceProperty > failed to be resolved" error. > > Marzia, you have my app ID from a private e-mail regarding a different > thread -- the one regarding the Datastore Indices Count quota. > > On Dec 29 2008, 1:53 pm, Marzia Niccolai <ma...@google.com> wrote: > > Hi, > > > > What is the value of the key when you use get_value_for_datastore on this > > property? See recipe: > http://appengine-cookbook.appspot.com/recipe/getting-dbreferenceprope... > > > > -Marzia > > > > On Sun, Dec 28, 2008 at 11:41 AM, dloomer <dloo...@gmail.com> wrote: > > > > > Getting a "ReferenceProperty failed to be resolved" error and I can > > > swear up and down that the ReferenceProperty *should* be able to be > > > resolved -- i.e., this is not your classic case of referenced entities > > > being deleted, as the data is all there. > > > > > Model definition (abridged): > > > > > class ChatWordStats(db.Model): > > > chatword = db.ReferenceProperty(ChatWord) > > > timespan = db.ReferenceProperty(StatsTimeSpan) > > > date = db.DateTimeProperty(auto_now_add=True) > > > > > class TeamChatWordStats(db.Model): > > > team = db.ReferenceProperty(Team,required=True) > > > chatwordstats = db.ReferenceProperty(ChatWordStats) > > > date = db.DateTimeProperty(auto_now_add=True) > > > > > offending code (this has worked fine for thousands of entities, then > > > just gets stuck on this one): > > > > > tcws = dygmodel.TeamChatWordStats.get(key_val) > > > cws = tcws.chatwordstats > > > > > The first line works, and the second line gives the error. The > > > key_val for the TeamChatWordStats entity is > > > > > > ahJkeWluZ2dpcmFmZmVsZWFndWVyPAsSEVRlYW1DaGF0V29yZFN0YXRzIiV0Y3dzX3RfNV9jd3N > fdHNfM18yMDA1XzNfMV8wX2N3X19hbGxfDA. > > > Looking up the entity in the Data Viewer of my application console, > > > that shows a chatwordstats property with a key of > > > > > > ahJkeWluZ2dpcmFmZmVsZWFndWVyLwsSDUNoYXRXb3JkU3RhdHMiHGN3c190c18zXzIwMDVfM18 > xXzBfY3dfX2FsbF8M. > > > This key also resolves fine in the Data Viewer. > > > > > And, just in case, I verified that both ReferenceProperty values on > > > the ChatWordStats entity resolve as well. > > > > > So, where does that leave me? I've double and triple and quadruple- > > > checked everything and I'm kind of stuck. I can provide my app name > > > in a private e-mail if asked. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---