Skip to content

Commit be5edde

Browse files
committed
Merge pull request #258 from tseaver/167-connection_save_entity
Fix #167: Update docstring for 'Connection.save_entity'.
2 parents 906700b + 8e40313 commit be5edde

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

gcloud/datastore/connection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@ def commit(self, dataset_id, mutation_pb):
338338
def save_entity(self, dataset_id, key_pb, properties):
339339
"""Save an entity to the Cloud Datastore with the provided properties.
340340
341+
.. note::
342+
Any existing properties for the entity identified by 'key_pb'
343+
will be replaced by those passed in 'properties'; properties
344+
not passed in 'properties' no longer be set for the entity.
345+
341346
:type dataset_id: string
342347
:param dataset_id: The dataset in which to save the entity.
343348

gcloud/datastore/entity.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ def reload(self):
187187
def save(self):
188188
"""Save the entity in the Cloud Datastore.
189189
190+
.. note::
191+
Any existing properties for the entity will be replaced by those
192+
currently set on this instance. Already-stored properties which do
193+
not correspond to keys set on this instance will be removed from
194+
the datastore.
195+
190196
:rtype: :class:`gcloud.datastore.entity.Entity`
191197
:returns: The entity with a possibly updated Key.
192198
"""

0 commit comments

Comments
 (0)