Google App Engine과 Python을 사용하고 있습니다. 이 JSON + 파이썬 + GAE 데이터 저장소 작업 내 처음이다, 내 질문이는 것 같다이다Datastore에서 JSON을 올바르게 저장하고 가져 오는 방법은 무엇입니까?
{"large":"10","medium":"5","small":"24"}
: 나는이 작업을 수행 할 때
class Spam(db.Model)
eggs = db.TextProperty
# Create some json and store it to a Spam Entity
eggs_dict = {"large":10, "medium":5, "small":24}
eggs_json = simplejson.dumps(eggs)
spam = Spam(eggs=db.Text(eggs_json))
# Later, fetch spam and then return the json as part of a Response
self.response.out.write(spam.eggs)
나는처럼 보이는 응답을 얻을 JSON Strings를 저장하고 가져 오는 올바른 방법이긴하지만이 디자인 패턴을 다른 엔터티에 적용하기 전에이 패턴이 좋은지, 길 아래의 데이터 오류가 발생하지 않는지 확인하고 싶었습니다. 특히 Datastore의 내부 또는 외부에서 인코딩을 수행해야합니까?