Commit a6ebf5f3 authored by chirac's avatar chirac
Browse files

Supprime des contraintes inutiles

parent 23bff525
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('machines', '0009_auto_20160703_2358'),
]
operations = [
migrations.AlterField(
model_name='machine',
name='name',
field=models.CharField(blank=True, unique=True, max_length=255, help_text='Optionnel', null=True),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('machines', '0010_auto_20160704_0104'),
]
operations = [
migrations.AlterField(
model_name='machine',
name='name',
field=models.CharField(help_text='Optionnel', blank=True, null=True, max_length=255),
),
]
......@@ -7,7 +7,7 @@ from users.models import User
class Machine(models.Model):
user = models.ForeignKey('users.User', on_delete=models.PROTECT)
type = models.ForeignKey('MachineType', on_delete=models.PROTECT)
name = models.CharField(max_length=255, help_text="Optionnel", unique=True, blank=True)
name = models.CharField(max_length=255, help_text="Optionnel", blank=True, null=True)
def __str__(self):
return str(self.user) + ' - ' + str(self.id) + ' - ' + str(self.name)
......@@ -25,7 +25,7 @@ class Interface(models.Model):
mac_address = MACAddressField(integer=False, unique=True)
machine = models.ForeignKey('Machine', on_delete=models.PROTECT)
details = models.CharField(max_length=255, blank=True)
dns = models.CharField(max_length=255, unique=True)
dns = models.CharField(help_text="Obligatoire et unique", max_length=255, unique=True)
def __str__(self):
return self.dns
......@@ -43,7 +43,7 @@ class EditMachineForm(ModelForm):
def __init__(self, *args, **kwargs):
super(EditMachineForm, self).__init__(*args, **kwargs)
self.fields['name'].label = 'Nom de la machine (optionnel)'
self.fields['name'].label = 'Nom de la machine'
self.fields['type'].label = 'Type de machine'
class NewMachineForm(EditMachineForm):
......@@ -57,7 +57,7 @@ class EditInterfaceForm(ModelForm):
def __init__(self, *args, **kwargs):
super(EditInterfaceForm, self).__init__(*args, **kwargs)
self.fields['dns'].label = 'Nom dns de la machine (unique)'
self.fields['dns'].label = 'Nom dns de la machine'
self.fields['mac_address'].label = 'Adresse mac'
class AddInterfaceForm(EditInterfaceForm):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment