Skip to content

[Documentation Issue]  #1552

Description

@mbasilyan

Page Name: datastore-queries
Release: 0.10.1

This python code (a close copy of one of the pieces in the tutorials), yields an error:

from gcloud import datastore
ds_client = datastore.Client(project='mikes-playground-project')
#key = client.key('Person')#
#entity = datastore.Entity(key=key)
#entity['name'] = 'Your name'
#entity['age'] = 25
#client.put(entity)
#print("And Out..")
query = datastore.Query('Person')
query.add_filter('age', '<', '100')
list(query.fetch(1), client=ds_client) #even if you remove client=...

results in the following error

> basilyan@instance-3:~$ python ds.py
> Traceback (most recent call last):
>   File "ds.py", line 12, in <module>
>     query = datastore.Query('Person')
>   File "/usr/local/lib/python2.7/dist-packages/gcloud/datastore/query.py", line 88, in __init__
>     self._project = project or client.project
> AttributeError: 'str' object has no attribute 'project'

Using Python 2.7 and gcloud (0.10.1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions