84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
就是写关系的时候必须要在属性上加有ForeignKey,但是能不能不加约束,仅仅指定外键就使用SQLAlchemy的relationship?
ForeignKey
relationship
认证高级PHP讲师
Since you don’t need constraints, why do you need foreign keys? ? ? Just set a field to store the corresponding relationship
Adding foreign keys can maintain data integrity, and you can also set up relationships yourself. That kind of control is easy to use
In Python, you can use properties directly instead of foreign keys, but you need to do more work yourself
Since you don’t need constraints, why do you need foreign keys? ? ? Just set a field to store the corresponding relationship
Adding foreign keys can maintain data integrity, and you can also set up relationships yourself. That kind of control is easy to use
In Python, you can use properties directly instead of foreign keys, but you need to do more work yourself