Dev Server Datastore difference with AppEngine Datastore [closed]?

Up vote 1 down vote favorite share g+ share fb share tw.

Possible Duplicate: Filtering by entity key name in Google App Engine on Python When I look at the datastore on my dev server admin console: Key ID .... ag5zcn... 12001 but when I look at the datastore on AppEngine for the same application, I get something like: ID/Name id=1348 I want to retrieve a batch of entities based on "ID" >= $someid. How would I do that? Python google-app-engine google link|improve this question asked May 18 '11 at 13:20jldupont20.6k535100 94% accept rate.

All entities have either a user-assigned name or a system-assigned ID. All entities have a key, which is a representation of the full path to an entity, including app ID, ancestors, kind, and name or ID, serialized to a protocol buffer and encoded as base64. The dev and production servers present the data in slightly different ways, but it's exactly the same data.

You can fetch a list of entities by ID using Model. Get_by_id(ids).

ID's will differ from dev_server to live server. ID is nothing but the part of unique key which is used to identify the object in the datastore which is also unique indeed. Usually you can get a ID of an object inside python by calling object.key().id(), if you are passing the object to template , in template id can be got by calling object.key.id.

Passing this id to model. Get_by_id() will get you the object, if you have list of id's , you can pass the list of id's to get_by_id() to get those objects. There is also key_name attribute , which you assign to a object, which is supposed to be a unique attribute.

Model. Get_or_insert() and Model. Get_by_key_name() are the methods used to retrieve objects based on key_name, former just gets the object for the passed key_name.

Where else latter gets the object for the given key_name if it exists ,else creates one and gives it back. Key_name can be assigned like user = User_Model(key_name = 'some unique value like user_id') And also there is Model.get() which gets the object for the passed key and returns a list of objects on passing a list of keys.

I believe this has already been answered there.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions