0
我需要訂單/購買,讓例如像正確使用重複屬性?
class Purchase(db.Model):
'''a completed transaction'''
item = db.ReferenceProperty(Item, repeated=True))
許多項目是重複的關鍵字法律和在這裏正確的方式使用?我的其他選擇是什麼?我應該用重複的stringproperty來代替嗎?
item_ids = model.StringProperty(repeated=True)
或重複KeyProperties? 感謝
嗨,尼克。 :-)混淆似乎在NDB和db之間。在NDB中,您使用repeat = True,而在db中使用ListProperty。 – 2012-01-30 01:19:59
謝謝你的回答和評論。對於我的模型來說最自然的將是一個重複的Keyproperty,我會嘗試它的工作原理,因爲我喜歡NDB使用鍵和清晰語法的方式。 – 2012-01-30 05:45:36
我甚至不知道'ndb'。非常感謝您的評論! – Ski 2012-01-30 07:57:12