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
>
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
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
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