Skip to content

Commit

Permalink
Merge pull request #331 from tseaver/266-document_text_vs_bytes_values
Browse files Browse the repository at this point in the history
Fix #266: Document further how 'text' vs. 'bytes' values are stored.
  • Loading branch information
tseaver committed Nov 4, 2014
2 parents 2b73c7b + 95336d9 commit abe3d7c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gcloud/datastore/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ class Entity(dict):
>>> dict(entity)
{'age': 20, 'name': 'JJ'}
.. note::
When saving an entity to the backend, values which are "text"
('unicode' in Python2, 'str' in Python3) will be saved using
the 'text_value' field, after being encoded to UTF-8. When
retrieved from the back-end, such values will be decoded to "text"
again. Values which are "bytes" ('str' in Python2, 'bytes' in
Python3), will be saved using the 'blob_value' field, without
any decoding / encoding step.
"""

def __init__(self, dataset=None, kind=None):
Expand Down

0 comments on commit abe3d7c

Please sign in to comment.