1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Convert NullBooleanField to BooleanField(null=True)

This commit is contained in:
Jeremy Stretch
2020-07-16 11:56:35 -04:00
parent 8dd41b771e
commit 68ecddccdb
5 changed files with 82 additions and 14 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.1b1 on 2020-07-16 15:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('circuits', '0018_standardize_description'),
]
operations = [
migrations.AlterField(
model_name='circuittermination',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
]

View File

@ -275,9 +275,10 @@ class CircuitTermination(CableTermination):
blank=True,
null=True
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
port_speed = models.PositiveIntegerField(
verbose_name='Port speed (Kbps)'

View File

@ -0,0 +1,43 @@
# Generated by Django 3.1b1 on 2020-07-16 15:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0112_standardize_components'),
]
operations = [
migrations.AlterField(
model_name='consoleport',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
migrations.AlterField(
model_name='consoleserverport',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
migrations.AlterField(
model_name='interface',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
migrations.AlterField(
model_name='powerfeed',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
migrations.AlterField(
model_name='poweroutlet',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
migrations.AlterField(
model_name='powerport',
name='connection_status',
field=models.BooleanField(blank=True, null=True),
),
]

View File

@ -1905,9 +1905,10 @@ class PowerFeed(ChangeLoggedModel, CableTermination, CustomFieldModel):
blank=True,
null=True
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
name = models.CharField(
max_length=50

View File

@ -264,9 +264,10 @@ class ConsolePort(CableTermination, ComponentModel):
blank=True,
null=True
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
tags = TaggableManager(through=TaggedItem)
@ -304,9 +305,10 @@ class ConsoleServerPort(CableTermination, ComponentModel):
blank=True,
help_text='Physical port type'
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
tags = TaggableManager(through=TaggedItem)
@ -370,9 +372,10 @@ class PowerPort(CableTermination, ComponentModel):
blank=True,
null=True
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
tags = TaggableManager(through=TaggedItem)
@ -505,9 +508,10 @@ class PowerOutlet(CableTermination, ComponentModel):
blank=True,
help_text="Phase (for three-phase feeds)"
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
tags = TaggableManager(through=TaggedItem)
@ -598,9 +602,10 @@ class Interface(CableTermination, ComponentModel, BaseInterface):
blank=True,
null=True
)
connection_status = models.NullBooleanField(
connection_status = models.BooleanField(
choices=CONNECTION_STATUS_CHOICES,
blank=True
blank=True,
null=True
)
lag = models.ForeignKey(
to='self',