Possible Duplicate:
How to implement “autoincrement” on Google AppEngine
I've got a Python App in AppEngine. I'm using High Replication Datastore.
This is my problem:
I have an entity (call it Person for simplicity) that is saved without parents, it's a root entity in the AppEngine terms.
I don't set a key_name before save my entities, becouse i want the numeric IDs assigned by the DataStore. Some Code:
p = Person(name='Juan Roman Riquelme')
p.put()
p.key().id() # the numeric ID
The problem is that the IDs are not consecutive. Every time i update my app (appcfg.py update .) the ids start in the next thousands. I mean, the first time i update my app, the IDs where 1,2,3,etc. The next time were: 1001,1002,1003, etc. The thirth: 2001,2002, etc.
What's going on? What should i do to keep them consecutive?
Thanks!