이 당신이 원하는 무엇인가?
코드 :
from google.appengine.ext import db
class Field(db.Model):
author = db.StringProperty()
content = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)
a = Field(author="me")
a.put()
편집 :
field = Field.all()
for f in field:
print f.author
print f.content
props = Field.properties()
print props
for vals in props:
print vals
출력 :
<__main__.Field object at 0xb8c9e4c>
{'content': <google.appengine.ext.db.StringProperty object at 0xb7c0aec>, 'date': <google.appengine.ext.db.DateTimeProperty object at 0xb7c06cc>, 'author': <google.appengine.ext.db.StringProperty object at 0xb7c0f6c>}
content
date
author
아마도''names''와''field.keys()''를 인쇄 해 보았습니까? 아마도 오류가 유효하기 때문입니다. – sotapme
@sotapme 이름이 올바르게 인쇄됩니다. Get – Saqib