Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #266: Document further how 'text' vs. 'bytes' values are stored. #331

Merged
merged 2 commits into from
Nov 4, 2014
Merged
Changes from all commits
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
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.

This comment was marked as spam.

This comment was marked as spam.

"""

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