mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	Extend CustomField migration to update CustomFieldChoice.field.limit_choices_to
This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
import django.db.models.deletion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
CUSTOMFIELD_TYPE_CHOICES = (
 | 
			
		||||
@@ -48,6 +49,13 @@ class Migration(migrations.Migration):
 | 
			
		||||
            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
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='customfield',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user