Reputation: 14539
I want something functionally equivalent to a string->string
key-value store in app engine ndb, similar to Couchbase. I don't want to model anything. What options do I have?
Upvotes: 2
Views: 151
Reputation: 10360
Something like this?
class KVStore(ndb.Model):
v = ndb.TextProperty()
@classmethod
def get(cls, k):
e = cls.get_by_id(k)
return e.v if e else None
@classmethod
def set(cls, k, v):
e = cls(id=k, v=v)
e.put()
Upvotes: 2