Skip to main content

gcloud-datastore-oem is a Python Object-Entity Mapper for working with Google Datastore.

Project description

Python object to entity mapper for Google Datastore with Django support.

Quickstart

from gcloudoem import *

class TestEntity(Entity):
    name = TextProperty()


class OtherTestEntity(Entity):
    address = TextProperty(default='blah')
    te = ListProperty(ReferenceProperty(TestEntity))

connect(dataset_id='dataset_id', namespace='demo')

es = TestEntity.objects.filter(name='Alice')
oe = OtherTestEntity(te=[e for e in es])
oe.save()
ot = OtherTestEntity.objects.get(pk=oe.key.name_or_id)
print(ot.key.name_or_id, [te.name for te in ot.te])
query = query.Query(TestEntity)
query.add_filter("name", "=", "Kris")
cursor = query()
print([(e.name, e.key.name_or_id,) for e in list(o)])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

gcloudoem-0.1.0rc1.tar.gz (59.4 kB view hashes)

Uploaded Source

gcloudoem-0.1.0rc1.macosx-10.10-x86_64.tar.gz (126.0 kB view hashes)

Uploaded Source

Built Distribution

gcloudoem-0.1.0rc1-py2.py3-none-any.whl (77.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page