Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Document further how 'text' vs. 'bytes' values are stored.
Note how the two differ in Python2 vs. Python3.

Fixes #266.
  • Loading branch information
tseaver committed Nov 3, 2014
commit b7ec4375d2e1da72a2fedb3d57541816bd6b7ab1
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 'bytes_value' field, without

This comment was marked as spam.

any decoding / encoding step.

This comment was marked as spam.

This comment was marked as spam.

"""

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