diff --git a/netbox/circuits/forms.py b/netbox/circuits/forms.py index fabdad25d..edf974d62 100644 --- a/netbox/circuits/forms.py +++ b/netbox/circuits/forms.py @@ -7,7 +7,7 @@ from utilities.forms import ( SlugField, ) -from .models import PORT_SPEED_CHOICES, Circuit, CircuitType, Provider +from .models import Circuit, CircuitType, Provider # @@ -176,9 +176,8 @@ class CircuitBulkEditForm(forms.Form, BootstrapMixin): pk = forms.ModelMultipleChoiceField(queryset=Circuit.objects.all(), widget=forms.MultipleHiddenInput) type = forms.ModelChoiceField(queryset=CircuitType.objects.all(), required=False) provider = forms.ModelChoiceField(queryset=Provider.objects.all(), required=False) - port_speed = forms.ChoiceField(choices=[(None, '---------')] + PORT_SPEED_CHOICES, required=False, - label='Port speed') - commit_rate = forms.IntegerField(required=False, label='Commit rate (Mbps)') + port_speed = forms.IntegerField(required=False, label='Port speed (Kbps)') + commit_rate = forms.IntegerField(required=False, label='Commit rate (Kbps)') comments = CommentField() diff --git a/netbox/circuits/migrations/0002_auto_20160620_1929.py b/netbox/circuits/migrations/0002_auto_20160620_1929.py new file mode 100644 index 000000000..cf63d7251 --- /dev/null +++ b/netbox/circuits/migrations/0002_auto_20160620_1929.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-06-20 19:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('circuits', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='circuit', + name='commit_rate', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name=b'Commit rate (Kbps)'), + ), + migrations.AlterField( + model_name='circuit', + name='port_speed', + field=models.PositiveIntegerField(verbose_name=b'Port speed (Kbps)'), + ), + ] diff --git a/netbox/circuits/models.py b/netbox/circuits/models.py index 738cefb6f..b82706e66 100644 --- a/netbox/circuits/models.py +++ b/netbox/circuits/models.py @@ -4,24 +4,6 @@ from django.db import models from dcim.models import Site, Interface -PORT_SPEED_100M = 100 -PORT_SPEED_1G = 1000 -PORT_SPEED_10G = 10000 -PORT_SPEED_25G = 25000 -PORT_SPEED_40G = 40000 -PORT_SPEED_50G = 50000 -PORT_SPEED_100G = 100000 -PORT_SPEED_CHOICES = [ - [PORT_SPEED_100M, '100 Mbps'], - [PORT_SPEED_1G, '1 Gbps'], - [PORT_SPEED_10G, '10 Gbps'], - [PORT_SPEED_25G, '25 Gbps'], - [PORT_SPEED_40G, '40 Gbps'], - [PORT_SPEED_50G, '50 Gbps'], - [PORT_SPEED_100G, '100 Gbps'], -] - - class Provider(models.Model): """ A transit provider, IX, or direct peer @@ -81,8 +63,8 @@ class Circuit(models.Model): site = models.ForeignKey(Site, related_name='circuits', on_delete=models.PROTECT) interface = models.OneToOneField(Interface, related_name='circuit', blank=True, null=True) install_date = models.DateField(blank=True, null=True, verbose_name='Date installed') - port_speed = models.PositiveSmallIntegerField(choices=PORT_SPEED_CHOICES, verbose_name='Port speed') - commit_rate = models.PositiveIntegerField(blank=True, null=True, verbose_name='Commit rate (Mbps)') + port_speed = models.PositiveIntegerField(verbose_name='Port speed (Kbps)') + commit_rate = models.PositiveIntegerField(blank=True, null=True, verbose_name='Commit rate (Kbps)') xconnect_id = models.CharField(max_length=50, blank=True, verbose_name='Cross-connect ID') pp_info = models.CharField(max_length=100, blank=True, verbose_name='Patch panel/port(s)') comments = models.TextField(blank=True) diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index 68d503c8b..d2881932f 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -79,11 +79,11 @@