-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.
Description
Currently the following doesn't work:
class Foo(Entity):
def bar(self):
""" behavior dependent on internal properties such as _key """
ent = dataset.entity()
baz = Foo(ent)
baz.bar()
This is inconsistent with Entity inheriting dict. Besides style issues, I would think sub-classing Entity would be the preferred way to introduce custom behavior, or enforce an entity schema.
Current workaround is:
class Foo(Entity):
def __init__(self, ent):
self._entity = ent
def bar(self):
""" behavior dependent on _entity """
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.