Commit 48d76b3f authored by chirac's avatar chirac

Simplification, évite les imports circulaires, permet donc à un port d'avoir...

Simplification, évite les imports circulaires, permet donc à un port d'avoir une interface, et à une chambre d'avoir un port (<->)
parent a58e90cc
settings.py
settings*
settings_local.py
*.swp
*.pyc
__pycache__
......@@ -2,7 +2,6 @@ from django.db import models
from django import forms
from django.forms import ModelForm
from users.models import User
class Facture(models.Model):
user = models.ForeignKey('users.User', on_delete=models.PROTECT)
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import machines.models
class Migration(migrations.Migration):
dependencies = [
('machines', '0013_auto_20160705_1014'),
]
operations = [
migrations.AlterField(
model_name='interface',
name='dns',
field=models.CharField(unique=True, validators=[machines.models.full_domain_validator], max_length=255, help_text="Obligatoire et unique, doit se terminer en .rez et ne pas comporter d'autres points"),
),
]
......@@ -2,7 +2,6 @@ from django.db import models
from django.forms import ModelForm, Form, ValidationError
from macaddress.fields import MACAddressField
from users.models import User
from django.conf import settings
import re
......
......@@ -3,9 +3,6 @@ from django import forms
from django.forms import Form
from django.forms import ModelForm
from users.models import User
# Create your models here.
CHOICES = (
('0', 'Actifs'),
('1', 'Désactivés'),
......
......@@ -7,7 +7,7 @@ class SwitchAdmin(admin.ModelAdmin):
list_display = ('building','number','details')
class PortAdmin(admin.ModelAdmin):
list_display = ('switch', 'port','room','details')
list_display = ('switch', 'port','room','machine_interface','details')
class RoomAdmin(admin.ModelAdmin):
list_display = ('name',)
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('machines', '0014_auto_20160706_1220'),
('topologie', '0011_auto_20160704_2153'),
]
operations = [
migrations.AddField(
model_name='port',
name='machine_interface',
field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, null=True, blank=True, to='machines.Interface'),
),
]
......@@ -19,7 +19,7 @@ class Port(models.Model):
port = models.IntegerField()
details = models.CharField(max_length=255, blank=True)
room = models.ForeignKey('Room', on_delete=models.PROTECT, blank=True, null=True)
# machine_interface = models.OneToOneField('machines.Interface', on_delete=models.PROTECT, blank=True, null=True)
machine_interface = models.OneToOneField('machines.Interface', on_delete=models.PROTECT, blank=True, null=True)
class Meta:
unique_together = ('_content_type', '_object_id')
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0015_whitelist'),
]
operations = [
migrations.AlterField(
model_name='ban',
name='date_end',
field=models.DateTimeField(help_text='%d/%m/%y %H:%M:%S'),
),
migrations.AlterField(
model_name='user',
name='pseudo',
field=models.CharField(unique=True, validators=[users.models.linux_user_validator], max_length=32, help_text='Doit contenir uniquement des lettres, chiffres, ou tirets'),
),
migrations.AlterField(
model_name='whitelist',
name='date_end',
field=models.DateTimeField(help_text='%d/%m/%y %H:%M:%S'),
),
]
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