Django manytomany独特的约束

时间:2017-04-03 21:25:34

标签: python django django-models

这是我的django模型:

unique_together = (('second_object', 'first_object',),) 

我想与

同时制作这个独特的约束
Reaction(first_object__id=2, second_object__id=1)

例如,我无法添加此对象

Reaction(first_object__id=1, second_object__id=2)

如果

node {
    //run stuff on any node
    node('agent'){
        //run stuff on agent; other node is still busy
    }
    //return to original node; no message since it is still open
}
//outside of all nodes

存在。 有什么想法吗?

0 个答案:

没有答案