2
class ProjectCategory(db.Model):
name = db.StringProperty("Category name", required = True)
def __str__(self):
return str(self.name)
class Project(db.Model):
name = db.StringProperty("Name", required = True)
category = db.ReferenceProperty(ProjectCategory)
description = db.TextProperty("Description", required = True)
#file_name = db.StringProperty("File name", required = True)
file = db.BlobProperty("Image")
whenstarted = db.DateTimeProperty("Start time")
whenended = db.DateTimeProperty("End Time")
def __str__(self):
return str(self.title)
如何獲得所有項目中類是CatName谷歌應用程序引擎 - 數據存儲 - GQL查詢
嗯
db.GqlQuery("SELECT * FROM Project WHERE category = :1", "CatName")
不工作?
謝謝你,編輯後它工作正常。 –