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

Entity documentation error #630

Closed
rstuart85 opened this issue Feb 13, 2015 · 4 comments
Closed

Entity documentation error #630

rstuart85 opened this issue Feb 13, 2015 · 4 comments
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@rstuart85
Copy link

Line 37 of gcloud.datastore.entity.Entity says

Use :func:`gcloud.datastore.get` to retrieve an existing entity."

There is no such function. I think you mean gcloud.datastore.api.get().

Also, on a side note but slightly related, I find the package name gcloud.datastore.entity.Entity strange. Why not just gcloud.datastore.Entity? Seems that the currnet approach probably goes against PEP 423 and 25.

@pdknsk
Copy link

pdknsk commented Feb 13, 2015

Both of these are available as aliases in 0.4.0 at least.

>>> import gcloud
>>> gcloud.datastore.api.get
<function get at 0x7f9113397488>
>>> gcloud.datastore.get
<function get at 0x7f9113397488>
>>> gcloud.datastore.entity.Entity
<class 'gcloud.datastore.entity.Entity'>
>>> gcloud.datastore.Entity
<class 'gcloud.datastore.entity.Entity'>

@dhermes
Copy link
Contributor

dhermes commented Feb 13, 2015

@rstuart85 You are both correct and "incorrect".

The classes and functions needed for datastore are loaded into the main namespace in __init__.py:

from gcloud import credentials
from gcloud.datastore import _implicit_environ
from gcloud.datastore.api import allocate_ids
from gcloud.datastore.api import delete
from gcloud.datastore.api import get
from gcloud.datastore.api import put
from gcloud.datastore.batch import Batch
from gcloud.datastore.connection import Connection
from gcloud.datastore.entity import Entity
from gcloud.datastore.key import Key
from gcloud.datastore.query import Query
from gcloud.datastore.transaction import Transaction

@pdknsk Thanks for the assist.

@dhermes dhermes closed this as completed Feb 13, 2015
@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Feb 13, 2015
@dhermes dhermes added this to the Datastore Stable milestone Feb 13, 2015
@tseaver
Copy link
Contributor

tseaver commented Feb 13, 2015

I find the package name gcloud.datastore.entity.Entity strange. Why not just gcloud.datastore.Entity? Seems that the currnet approach probably goes against PEP 423 and 25.

FWIW, on the terminology front:

  • gcloud and gcloud.datastore are packages
  • gcloud.datastore.entity is a module
  • gcloud.datastore.entity.Entity is a class. As @dhermes notes, it has a convenience alias, gcloud.datastore.Entity

@dhermes
Copy link
Contributor

dhermes commented Feb 13, 2015

👍 Thanks @tseaver

vchudnov-g pushed a commit that referenced this issue Sep 20, 2023
* migrate and delete

* add readme

* move to different folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

No branches or pull requests

4 participants