from google.appengine.ext import db
new_ids = db.allocate_ids(handmade_key, 1)
new_id_num = int(new_id[0])
new_key = db.Key.from_path('MyModel', new_id_num)
new_instance = MyModel(key=new_key)
Generating unique number sequence for use as entity key for app engine datastore