On Thu, Oct 2, 2008 at 8:31 AM, GMan <[EMAIL PROTECTED]> wrote: > > I am scratching my head at this seemingly simple problem. All I want > to do is: > 1) Take the value of a db.IntegerProperty > 2) increment it using a local variable > 3) Save the local variable back to the IntegerProperty > > class IncrementHolder: > counter = db.IntegerProperty() > > > class UserOfIncrementHolder: > def doSomething(self): > incrementQueryResult = IncrementHolder.all() #assume there is > only one of these > > incrementHolderObj = incrementQueryResult.get() > > currCountValue = incrementHolderObj.counter > > currCountValue += 1 ## This is where the error occurs !!
I guess you're geting a None value assigned to incrementHolderObj.counter, and adding a NoneType with an Int seems not to be allowed by python (though I'm not an expert). Why don't you try to check for None before? if currCountValue is None: currCountValue = 1 else currCountValue += 1 hope that helps. Best, Jose --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---