There is only one instance of ManifestVersion. I used versionList.count () and it returned 1. And I'm not really looking into ensuring the uniqueness in ManifestVersion. Latter that model will disappear and become just a variable in the user entity(which I haven't created yet), but thanks for the suggestion.
On Mar 15, 9:33 am, Marcelo Sena <marceloslace...@gmail.com> wrote: > I found something interesting. If i don't try to commit the > versionNumber, its value is set to 1. Could it be something wrong with > in my model? > > On Mar 15, 8:03 am, Tim Hoffman <zutes...@gmail.com> wrote: > > > Here's some things to look at. > > > versionumber must be 0 when you fetch it, are you sure there is only > > one instance of ManifestVersion, > > and if there is supposed to be only one, why the call to > > ManifestVersion.all(), you should just get the object by id or key. > > (Have you confirmed that there is only one instance returned from all > > () ?) > > my guess is you have more than one instance > > > T > > > On Mar 15, 1:55 pm, Marcelo Sena <marceloslace...@gmail.com> wrote: > > > > Here is the model I'm trying to update: > > > > class ManifestVersion(db.Model): > > > versionNumber = db.IntegerProperty() > > > > Here is the method that should change the only instance of the > > > previous model: > > > > def incrementVersion(): > > > versionList = ManifestVersion.all() > > > num = versionList[0].versionNumber > > > num = num+1 > > > versionList[0].versionNumber = num > > > versionList[0].put() > > > return versionList[0].versionNumber > > > > But the versionNumber value is never updated and this function always > > > returns 1. On the other hand num is changed in this call. > > > What am I doing wrong? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---