views:

240

answers:

3

Is it possible to retrieve an entity from google appengine using their numerical IDs and if so how? I tried using:

key = Key.from_path("ModelName", numericalId) m = ModelName.get(key)

but the key generated wasnt correct.

A: 

Getting an Entity Using a Key

Rik
A: 

Turns out I needed to do

key = Key.from_path( Application_ModelName, numeric_id )

wasn't clear till i looked at the dict() of an entity

A: 

You are looking for this: http://code.google.com/appengine/docs/python/datastore/modelclass.html#Model_get_by_id

yep, found it - thats the one ;-) thanks