1
由於某些原因,Django要求我隨機遷移,當此字段未更改時。遷移文件是相同的。Django CharField,選擇和遷移
型號:
PROGRESS_CHOICE = {
('1', '1.start'),
('2', '2.driver_arrived_pick_up'),
('3', '3.hope_in'),
('4', '4.driver_arrived_destination'),
('5', '5.end')
}
progress = models.CharField(max_length=20, choices=PROGRESS_CHOICE, default=1, blank=True)
遷移:1.
class Migration(migrations.Migration):
dependencies = [
('api', '0031_auto_20150603_1515'),
]
operations = [
migrations.AlterField(
model_name='ride',
name='progress',
field=models.CharField(max_length=20, default=1, blank=True, choices=[('1', '1.start'), ('3', '3.hope_in'), ('4', '4.driver_arrived_destination'), ('2', '2.driver_arrived_pick_up'), ('5', '5.end')]),
preserve_default=True,
),
]
2.
class Migration(migrations.Migration):
dependencies = [
('api', '0032_auto_20150603_1734'),
]
operations = [
migrations.AlterField(
model_name='ride',
name='progress',
field=models.CharField(default=1, max_length=20, choices=[('1', '1.start'), ('4', '4.driver_arrived_destination'), ('5', '5.end'), ('3', '3.hope_in'), ('2', '2.driver_arrived_pick_up')], blank=True),
preserve_default=True,
),
]
我的感謝,沒有注意到它:) – jTiKey