안녕하세요 저는 Udacity에서 웹 개발을하고 Python으로 Google 데이터 저장소를 실험하고 Blog라는 간단한 엔티티를 만들었습니다.Google 데이터 스토어 ID는 정수 대신 긴 유니 코드입니다.
localhost : admin 포트를 확인했는데 모든 ID는 '5249205949956096'과 같았습니다. 다른 모든 사람과 마찬가지로 '1', '2', '3'이어야합니다. 이 코드는 텍스트 편집기 또는 다른 코드와 함께 설정해야합니까?
class Blog(db.Model):
subject = db.StringProperty(required = True)
content = db.TextProperty(required =True)
created = db.DateTimeProperty(auto_now_add = True)
class NewPostHandler(Handler):
def get(self):
self.render("newpost.html")
def post(self):
subject = self.request.get("subject")
content = self.request.get("content")
if subject and content:
newblog=Blog(subject=subject,content=content)
newblog_key = newblog.put()
실제로는 문자열이 아니라 Long입니다. –