Skip to content

Commit 3d3ef13

Browse files
author
Jon Wayne Parrott
committed
Decode cursor before passing to template, fixes GoogleCloudPlatform#55
1 parent 1430e93 commit 3d3ef13

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

2-structured-data/bookshelf/model_datastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def list(limit=10, cursor=None):
5555
it = query.fetch(limit=limit, start_cursor=cursor)
5656
entities, more_results, cursor = it.next_page()
5757
entities = builtin_list(map(from_datastore, entities))
58-
return entities, cursor if len(entities) == limit else None
58+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5959
# [END list]
6060

6161

3-binary-data/bookshelf/model_datastore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
def read(id):

4-auth/bookshelf/model_datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
# [START list_by_user]
@@ -67,7 +67,7 @@ def list_by_user(user_id, limit=10, cursor=None):
6767
it = query.fetch(limit=limit, start_cursor=cursor)
6868
entities, more_results, cursor = it.next_page()
6969
entities = builtin_list(map(from_datastore, entities))
70-
return entities, cursor if len(entities) == limit else None
70+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
7171
# [END list_by_user]
7272

7373

5-logging/bookshelf/model_datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
def list_by_user(user_id, limit=10, cursor=None):
@@ -66,7 +66,7 @@ def list_by_user(user_id, limit=10, cursor=None):
6666
it = query.fetch(limit=limit, start_cursor=cursor)
6767
entities, more_results, cursor = it.next_page()
6868
entities = builtin_list(map(from_datastore, entities))
69-
return entities, cursor if len(entities) == limit else None
69+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
7070

7171

7272
def read(id):

6-pubsub/bookshelf/model_datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
def list_by_user(user_id, limit=10, cursor=None):
@@ -66,7 +66,7 @@ def list_by_user(user_id, limit=10, cursor=None):
6666
it = query.fetch(limit=limit, start_cursor=cursor)
6767
entities, more_results, cursor = it.next_page()
6868
entities = builtin_list(map(from_datastore, entities))
69-
return entities, cursor if len(entities) == limit else None
69+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
7070

7171

7272
def read(id):

7-gce/bookshelf/model_datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
def list_by_user(user_id, limit=10, cursor=None):
@@ -66,7 +66,7 @@ def list_by_user(user_id, limit=10, cursor=None):
6666
it = query.fetch(limit=limit, start_cursor=cursor)
6767
entities, more_results, cursor = it.next_page()
6868
entities = builtin_list(map(from_datastore, entities))
69-
return entities, cursor if len(entities) == limit else None
69+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
7070

7171

7272
def read(id):

optional-container-engine/bookshelf/model_datastore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def list(limit=10, cursor=None):
5252
it = query.fetch(limit=limit, start_cursor=cursor)
5353
entities, more_results, cursor = it.next_page()
5454
entities = builtin_list(map(from_datastore, entities))
55-
return entities, cursor if len(entities) == limit else None
55+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
5656

5757

5858
def list_by_user(user_id, limit=10, cursor=None):
@@ -66,7 +66,7 @@ def list_by_user(user_id, limit=10, cursor=None):
6666
it = query.fetch(limit=limit, start_cursor=cursor)
6767
entities, more_results, cursor = it.next_page()
6868
entities = builtin_list(map(from_datastore, entities))
69-
return entities, cursor if len(entities) == limit else None
69+
return entities, cursor.decode('utf-8') if len(entities) == limit else None
7070

7171

7272
def read(id):

0 commit comments

Comments
 (0)