Hi guys,
I am new to gae and knew count() only return the exact num only when
the num is less than 1000
and I read the article about sharded counter
here: http://code.google.com/intl/en/appengine/articles/sharding_counters.html.
so I start to use it in my own project
like this:
import counter
class MyModel(db.Model):
name = db.StringProperty()
#overwrite put so when new one is saved, counter + 1
def put(self):
def txn():
counter.increment('MyModel')
return super(Mymodel, self).put()
return db.run_in_transaction(txn)
howerver, when I test this code, get a error "BadRequestError: Nested
transactions are not supported.
"
I know why. howerver, i can not figure out how to go through it
beacuse i want save a entity and increase counter in a transaction
any ideas?
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---