Просмотр исходного кода

Extend CustomField migration to update CustomFieldChoice.field.limit_choices_to

Jeremy Stretch 6 лет назад
Родитель
Сommit
4e1ee270cf
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      netbox/extras/migrations/0029_3569_customfield_fields.py

+ 8 - 0
netbox/extras/migrations/0029_3569_customfield_fields.py

@@ -1,4 +1,5 @@
 from django.db import migrations, models
 from django.db import migrations, models
+import django.db.models.deletion
 
 
 
 
 CUSTOMFIELD_TYPE_CHOICES = (
 CUSTOMFIELD_TYPE_CHOICES = (
@@ -48,6 +49,13 @@ class Migration(migrations.Migration):
             code=customfield_type_to_slug
             code=customfield_type_to_slug
         ),
         ),
 
 
+        # Update CustomFieldChoice.field.limit_choices_to
+        migrations.AlterField(
+            model_name='customfieldchoice',
+            name='field',
+            field=models.ForeignKey(limit_choices_to={'type': 'select'}, on_delete=django.db.models.deletion.CASCADE, related_name='choices', to='extras.CustomField'),
+        ),
+
         # CustomField.filter_logic
         # CustomField.filter_logic
         migrations.AlterField(
         migrations.AlterField(
             model_name='customfield',
             model_name='customfield',