2011-09-18 18 views
1

我正在研究將代碼庫從使用app engine patch轉換爲使用django-nonrel時面臨的挑戰。如何用django-nonrel中的Django功能替換應用程序引擎的「父」字段?

我有現有的數據,其中Visit有parent entity患者。所以:

class Patient(db.Model): 
    ... 

class Visit(db.Model): 
    ... 

patient = Patient(...) 
visit = Visit(parent=patient, ...) 

如何在僅使用django-nonrel代碼時繼續這種關係?例如,當患者和訪問來自django.db.models.Model時,如何創建新的訪問?如何查詢訪問,指定父患者?等等。

我願意使用後端特定的接口。

回答

0

我可能已經找到答案:不支持。 Source舉報:

# for now we do not support KeyFields thus a Key has to be the own 
# primary key 
# TODO: GAE: support parents via GAEKeyField 
assert value.parent() is None, "Parents are not yet supported!" 
相關問題