我有一个Django项目,开始输入遗产数据库。 因此,有一个具有综合主要钥匙的模式。 只要我只使用遗留数据,但我现在要补充新的数据,而我所创造的形式告诉我,我正试图插入重复数据,大概是因为它只是把一个领域视为首要关键。
Now I want to change the model to use an autoincrement primary key, like one Django would automatically add. I tried removing the primary key attributes from the fields and putting them in unique_together in the Meta inner class. When I ran schemamigration
with South, it wanted to add an id
field as expected, but it asked for a default value.
我怎么能具体指出,南方应当以某种方式分配独特的钥匙,这对一个汽车加油场来说是合理的? (一) 将顺序[1.n]分配给某些任意记录顺序
If this is impossible is there another way to accomplish the same thing, preferably using Django and South?