Re: [google-appengine] Re: updating an existing entity python google app engine

2010-12-27 Thread Tim Hoffman
Hi This example is really inefficient and broken. (I didn't originally post any code because the OP obviously hadn't done any reading) >test = Test.gql("WHERE name = :1", "blah") # First check if name=blah > exists > if test.count(1) == 1: # If Already exists update pagehit += 1 >

Re: [google-appengine] Re: updating an existing entity python google app engine

2010-12-27 Thread Sarfaraz
Sorry Typo in my earlier email: It should be If Count(1) = 1 : Pagehit *+*= 1 not Pagehit = 1 -- 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-appeng...@googlegroups.com. To unsubscribe fro

Re: [google-appengine] Re: updating an existing entity python google app engine

2010-12-27 Thread Sarfaraz
Try This: test = Test.gql("WHERE name = :1", "blah") # First check if name=blah exists if test.count(1) == 1: # If Already exists update pagehit += 1 test.pagehit = 1 test.put() else: # If not exists then create new test = Test() test.name

[google-appengine] Re: updating an existing entity python google app engine

2010-12-26 Thread Tim Hoffman
Hi You need to read the getting started on the datastore, you are making some basic errors there. http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html Each time that code is run you are creating a new entity, not fetching an existing one. Rgds T -- You received