diff --git a/machines/migrations/0010_auto_20160704_0104.py b/machines/migrations/0010_auto_20160704_0104.py new file mode 100644 index 00000000..37417dbb --- /dev/null +++ b/machines/migrations/0010_auto_20160704_0104.py @@ -0,0 +1,19 @@ +# -*- 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), + ), + ] diff --git a/machines/migrations/0011_auto_20160704_0105.py b/machines/migrations/0011_auto_20160704_0105.py new file mode 100644 index 00000000..7f8bfd00 --- /dev/null +++ b/machines/migrations/0011_auto_20160704_0105.py @@ -0,0 +1,19 @@ +# -*- 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), + ), + ] diff --git a/machines/models.py b/machines/models.py index 86e928b2..1cf9c557 100644 --- a/machines/models.py +++ b/machines/models.py @@ -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):