Re: [google-appengine] Re: How to write entity key safely in a form?

2010-04-22 Thread Matt Conrad
Good to know. The memcache approach sounds better to me too, but probably overkill for now. Thanks for the suggestions. Matt On Wed, Apr 21, 2010 at 11:51 PM, Tristan tristan.slomin...@gmail.com wrote: You could create a brand new entity with something like Entity entity = new

[google-appengine] Re: How to write entity key safely in a form?

2010-04-21 Thread Tristan
the goal entity should have a user's entity key that you get out of the session object on the server. when you then process 'complete' action, you should check first that the user's entity key in goal entity matches the one you got from server session. otherwise you're leaving yourself

Re: [google-appengine] Re: How to write entity key safely in a form?

2010-04-21 Thread Matt Conrad
Doh. I was thinking that I would avoid an extra trip to the datastore this way. But of course I have to do the .get() in order to change the goal entity. At which point I can check the user's key as you suggest. Please excuse my thinko. Unless there is a way to do a .put() on an pre-existing

[google-appengine] Re: How to write entity key safely in a form?

2010-04-21 Thread Tristan
You could create a brand new entity with something like Entity entity = new Entity(entityKey). You could then populate it with the data and then do a .put(entity). This will effectively execute an update without doing a .get(), but you have to trust your data because you're replacing what you