Since SDK 1.2.6, your can specify a key for a new entity:

key = db.Key.from_path('MyModel', 1234)
MyModel(key=key).put()

So if you have an id or key_name field, you can specify its key, and
it won't put duplicate entities with the same key into databstore
(just rewrite them).

2009/11/13 Baron <[email protected]>:
> Hello,
>
> I am uploading some data and sometimes a put() fails (TimeoutError) so
> that only a subset of the records are added. If I put() the records
> again then there will be duplicates.
>
> I first thought of using transactions, but creating entity groups
> seems awkward for my dataset - I have 100000 records with no logical
> groups.
>
> I was thinking would an easier workaround be to just give each record
> a unique key_name, so that if it was uploaded twice it would just
> override the previous record. Is that a sensible solution?
>
> Thanks
>
> --
>
> 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=.
>
>
>

--

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=.


Reply via email to