Okay, so I don't rely on googleKey, but instead, I create my own unique key, like maybe a UUID ?!
On Nov 14, 1:43 am, Bassil Karam <[email protected]> wrote: > Hey Rainer, you don't need to read first. This code snippet updates the same > record (tests-thinkloop.appspot.com): > > <cfscript> > kaka = createObject('component', 'visitor'); > kaka.setMessage('this is a msg'); > kaka.setDateTime(now()); > kaka.setRemoteHost('this is a remote host'); > kaka.setReferer('this is a referer'); > > googleWrite(kaka, 'bazkind', 'mykey123'); > > pipi = createObject('component', 'visitor'); > pipi.setMessage('this is a msg 2'); > pipi.setDateTime(now()); > pipi.setRemoteHost('this is a remote host 2'); > pipi.setReferer('this is a referer'); > > googleWrite(pipi, 'bazkind', 'mykey123'); > </cfscript> > > Cheers, > Baz > > On Fri, Nov 13, 2009 at 4:14 PM, Rainer <[email protected]> wrote: > > > Guys, > > > Maybe I can't find it in the GoogleAppEngine:Datastore documentation, > > but I was wondering how I can update an object in the GAE datastore? > > > For instance: > > > I create an object from my Country component with CreateObject, give > > all properties a value, and use 'googleKey = googleWrite(object)' to > > store it in de datastore. > > > Next request, I submit new property values + googleKey. What should I > > do: > > > 1) object = GoogleRead( googleKey), update values of object with form > > values, and than googleWrite(object) ? > > > OR > > > 2) object = CreateObject().init(form), and than something like > > googleWrite(object,"form.googleKey") ? > > > In other words: must I first do a read from the datastore to update an > > object in there? Isn't that a performance issue? > > > Rainer. > > --~--~---------~--~----~------------~-------~--~----~ Open BlueDragon Public Mailing List http://groups.google.com/group/openbd?hl=en official site @ http://www.openbluedragon.org/ !! save a network - trim replies before posting !! -~----------~----~----~----~------~----~------~--~---
