Has anyone got any example code for creating a unique number sequence to be used as keys for an entity in a Google app engine datastore?
Would like to use sequential order numbers as the key.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
db.allocate_ids()as described here to generate unique IDs for your entities.Here’s a quick example derived from the example at the above link:
(issue 2970 reference)