Skip to content

Commit e1fd94f

Browse files
committed
Merge pull request #297 from tseaver/293-clarify_key_datastore_id_parameter
Address #293: document that app code should not pass 'dataset_id' to 'Key.__init__'.
2 parents 7d155f7 + a823baa commit e1fd94f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gcloud/datastore/key.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ def __init__(self, path=None, namespace=None, dataset_id=None):
2424
2525
:type dataset_id: string
2626
:param dataset: The dataset ID assigned by back-end for the key.
27-
Leave as None for newly-created keys.
27+
28+
.. note::
29+
30+
The key's ``_dataset_id`` field must be None for keys created
31+
by application code. The
32+
:func:`gcloud.datastore.helpers.key_from_protobuf` factory
33+
will be set the field to an appropriate value for keys returned
34+
from the datastore backend. The application **must** treat any
35+
value set by the back-end as opaque.
2836
"""
2937
self._path = path or [{'kind': ''}]
3038
self._namespace = namespace

0 commit comments

Comments
 (0)