時尚待模型操作,我得到以下錯誤:未處理嘗試當我在我的項目的應用程序的一個執行遷移執行遷移
ValueError異常:未處理掛起操作適用機型: common.shipmentaddress(簡稱由字段:catalog.Fulfillment.address)
的Django 1.9,蟒蛇2.7.10
我一直在尋找的循環進口,但我不認爲這是它
這些機型:
class ShipmentAddress(models.Model):
recipient_first_name = models.CharField(max_length=50, null=True, blank=True)
recipient_last_name = models.CharField(max_length=50, null=True, blank=True)
street_name = models.CharField(max_length=50)
state = models.ForeignKey(State)
postal_code = models.IntegerField(default=0)
city = models.CharField(max_length=50)
class Meta:
db_table = 'shipment_address'
class Fulfillment(models.Model):
address = models.ForeignKey(ShipmentAddress)
inventory_items = models.ManyToManyField(Item_With_Size, through='Inventory_Item')
class Meta:
verbose_name = 'fulfilment'
verbose_name_plural = 'fulfilments'
db_table = 'fulfilment'
的遷移看起來像這樣:
class Migration(migrations.Migration):
dependencies = [
('catalog', '0009_auto_20151130_1118'),
]
operations = [
migrations.AlterField(
model_name='fulfillment',
name='address',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='common.ShipmentAddress'),
),
]
class Migration(migrations.Migration):
dependencies = [
('common', '0005_shipmentaddress'),
]
operations = [
migrations.RenameField(
model_name='shipmentaddress',
old_name='recipient_name',
new_name='recipient_first_name',
),
migrations.AddField(
model_name='shipmentaddress',
name='recipient_last_name',
field=models.CharField(blank=True, max_length=50, null=True),
),
]
你可以發佈違規模型的定義嗎? –
您可以發佈'common'和'catalog'應用程序的遷移,以及完整的追溯嗎? – knbk
我編輯問題 我做的實際遷移是在其他應用程序(以上都沒有) – segalle