-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
Milestone
Description
Since you are (optionally) associating Entities with Keys on instantiation, and since Entity inherits from dict I think it's reasonable to assume that all of the following would work.
ent1 = Entity(key=key1)
ent2 = Entity(key=key2)
assert not dict(ent1) == dict(ent2)
ent = Entity()
assert not 'key' in ent
ent['key'] = Key('Kind', 'id')
datastore.put(ent)
props={'prop1': 'value1', 'prop2':'value2'}
ent = Entity(key=key1, **props)
That said I'm still of the opinion that Entity should not be necessary as a class, using instead datastore.put(key, dict, **options) or, Entity should be completely key agnostic making implementation of the above easier.
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.