Make internal and external IP addresses of Networks unique
This commit is contained in:
parent
6d906abce3
commit
6b5819fb7f
2 changed files with 30 additions and 2 deletions
28
manager/migrations/0046_auto_20190219_1517.py
Normal file
28
manager/migrations/0046_auto_20190219_1517.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by Django 2.1.5 on 2019-02-19 15:17
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('manager', '0045_auto_20190219_1421'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='device',
|
||||||
|
name='wifi',
|
||||||
|
field=models.ManyToManyField(blank=True, to='manager.Wifi'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='network',
|
||||||
|
name='extip',
|
||||||
|
field=models.CharField(max_length=15, unique=True, verbose_name='External/Public IP'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='network',
|
||||||
|
name='intip',
|
||||||
|
field=models.CharField(max_length=15, unique=True, verbose_name='Internal/Private IP'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -15,8 +15,8 @@ class Organization(models.Model):
|
||||||
|
|
||||||
class Network(models.Model):
|
class Network(models.Model):
|
||||||
name = models.CharField("Common Name", max_length=64, blank=True, null=True)
|
name = models.CharField("Common Name", max_length=64, blank=True, null=True)
|
||||||
extip = models.CharField("External/Public IP", max_length=15)
|
extip = models.CharField("External/Public IP", max_length=15, unique=True)
|
||||||
intip = models.CharField("Internal/Private IP", max_length=15)
|
intip = models.CharField("Internal/Private IP", max_length=15, unique=True)
|
||||||
organization = models.ManyToManyField(Organization)
|
organization = models.ManyToManyField(Organization)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in a new issue