class User(db.Model):
username = db.StringProperty(required=True)
password = db.StringProperty(required=True)
email_address = db.StringProperty(required=True)
profile_img = db.BlobProperty()
class Book(db.Model):
user = db.ReferenceProperty(User, collection_name='books')
#first build
Book_1 = db.BooleanProperty(default=False)
Book_2 = db.BooleanProperty(default=False)
Book_3 = db.BooleanProperty(default=False)
Book_4 = db.BooleanProperty(default=False)
嗨,我想与这两个模型建立一对一的关系。我可以做些什么来使它永远不会为每个用户创建一个以上的 Book 模型?
谢谢。