LA_
LA_

Reputation: 20409

What to choose JsonProperty or StringProperty?

I would like to store dict-like data in GAE NDB (will contain up to 100 keys):

{u'[email protected]': 74, u'[email protected]': 1, u'[email protected]': 1, ...}

I was thinking about JsonProperty first, but once implemented, realized that it could not be read and edited in Datastore Viewer - <binary> is displayed instead. Should I use StringProperty then?

Upvotes: 1

Views: 229

Answers (1)

GAEfan
GAEfan

Reputation: 11360

Yes, StringProperty is an option, in some cases. Use JSON.dumps() and JSON.loads() to convert.

Upvotes: 1

Related Questions