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 stored with what was provided by the client.

Probably a "better" way, would be to store the entity in the memcache
when you serve it to the client, and then try the memcache.get()
before hitting the datastore when you get the 'complete' action, that
should execute fast, and then just .put() that.

On Apr 21, 10:43 pm, Matt Conrad <matt...@gmail.com> wrote:
> 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 entity without
> first doing a .get()?  I didn't see anything in the docs corresponding
> to a SQL UPDATE statement, but if there is a way to do this I'd
> definitely like to know about it.
>
> Matt
>
> On Wed, Apr 21, 2010 at 10:18 PM, Tristan <tristan.slomin...@gmail.com> wrote:
> > 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 vulnerable.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to