【发布时间】:2013-06-17 07:10:23
【问题描述】:
我有一个配置为使用 SQLite 的 Django 网络服务器。
在多对多关系(带有额外字段)中,Django 强制我使用关系模型来建立两个对象之间的关系。但我能够在相关表中尚不存在的对象之间创建关系。
例如:
I have table1 and table2 which are related via table12.
In table1, there is just one object called A.
In table2, there is just one object called X.
I can create a record in table12 that depict a relationship between A & Y; even though Y doesn't exist in table2.
我的关系模型已经适当地标记了外键。
【问题讨论】:
标签: django django-models sqlite referential-integrity