Elias
Elias

Reputation: 3360

AppEngine Primary Keys

by default, GAE adds a unique key to your db entries.

Is it possible to have a numeric unique key in addition?

Elias

Upvotes: 0

Views: 274

Answers (1)

Nick Johnson
Nick Johnson

Reputation: 101139

No - the only value that App Engine enforces uniqueness on is its own key. You can use your own numeric key in place of the autogenerated one, though. How you do so depends on your platform; on Python you do something like the following:

my_entity = ModelClass(key=db.Key.from_path('ModelClass', 1234), ...)

Upvotes: 2

Related Questions