thanks a lot Alex, In our application we need to create 200 entities in a single request,if we pass the key_name in constructor,Internally it makes a RPC call to the server every time which intern slows down my application, Because each RPC call takes nearly 10 millisecond(10*200 = 2 second).
so we planned to maintain a local cache, and then to commit all entities in a single RPC call. If I use the above method for assigning the key_name, will it make a RPC call every time? if it makes a RPC call,then is there any way to assign a key_name to a created entity(not yet saved) with out making RPC call. On Jan 29, 12:12 pm, Alexander Kojevnikov <[email protected]> wrote: > > I understand we won't be able to change the key_name after saving, > > Is it possible to set the key_name via some function call rather then > > setting via constructor(Before Saving),So that i can able to use > > get_by_key_name() once it is saved. > > Looking at the source code it appears that you can set the key_name > like this: > > entity = MyModel() > entity._key_name = my_key_name > entity.put() > > However, I don't recommend doing it as this method of setting the > key_name is not documented and can break in the future. > > Why wouldn't you initialise it in the constructor? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
