GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Add support for namespaces · Issue #1 · googleapis/google-cloud-python Closed Labels api: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. DescriptionThese exist to an extent but aren't universal and certainly not well documented. There are two options:
from gcloud import datastore dataset = datastore.get_dataset(...) namespace = dataset.namespace('my-namespace') person = namespace.entity('Person') person['name'] = 'JJ' person.save() query = namespace.query('Person') print query.fetch()
from gcloud import datastore dataset = datastore.get_dataset(...) person = dataset.entity('Person') person.namespace('my-namespace') person['name'] = 'JJ' person.save() query = dataset.query('Person').namespace('my-namespace') print query.fetch() or person = namespace.entity('Person') person['name'] = 'JJ' person.save(namespace='my-namespace') I currently prefer option 2, where a namespace isn't a separate level in the hierarchy, but simply a flag passed around on queries or entities. Activity
MetadataMetadataAssigneesLabelsapi: datastoreIssues related to the Datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |