Commit a61c0762 authored by chirac's avatar chirac
Browse files

Refondation de topologie

parent 857adf1e
from django.contrib import admin
from .models import Port, Room, Link
from .models import Port, Room, Switch
class PortAdmin(admin.ModelAdmin):
list_display = ('building','switch', 'port','details')
class SwitchAdmin(admin.ModelAdmin):
list_display = ('building','number','details')
class RoomAdmin(admin.ModelAdmin):
list_display = ('room','details')
class PortAdmin(admin.ModelAdmin):
list_display = ('switch', 'port','details')
class RoomAdmin(admin.ModelAdmin):
list_display = ('room','details')
class LinkAdmin(admin.ModelAdmin):
list_display = ('port', 'room','details')
list_display = ('building','room','number','details')
admin.site.register(Port, PortAdmin)
admin.site.register(Room, RoomAdmin)
admin.site.register(Link, LinkAdmin)
admin.site.register(Switch, SwitchAdmin)
......@@ -11,25 +11,12 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
name='Port',
name='Switch',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
('building', models.CharField(max_length=10)),
('switch', models.IntegerField()),
('port', models.IntegerField()),
('details', models.CharField(blank=True, max_length=255)),
('number', models.IntegerField()),
('details', models.CharField(max_length=255, blank=True)),
],
),
migrations.CreateModel(
name='Room',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('details', models.CharField(blank=True, max_length=255)),
('room', models.CharField(max_length=255)),
],
),
migrations.AlterUniqueTogether(
name='port',
unique_together=set([('building', 'switch', 'port')]),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('topologie', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Port',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('port', models.IntegerField()),
('details', models.CharField(max_length=255, blank=True)),
('_object_id', models.PositiveIntegerField(null=True, blank=True)),
('_content_type', models.ForeignKey(null=True, blank=True, to='contenttypes.ContentType')),
('switch', models.ForeignKey(related_name='ports', to='topologie.Switch')),
],
),
migrations.AlterUniqueTogether(
name='port',
unique_together=set([('_content_type', '_object_id')]),
),
]
......@@ -2,23 +2,22 @@
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topologie', '0002_auto_20160703_0103'),
('topologie', '0002_auto_20160703_1118'),
]
operations = [
migrations.CreateModel(
name='Link',
name='Room',
fields=[
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('details', models.CharField(blank=True, max_length=255)),
('port', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='topologie.Port')),
('room', models.ForeignKey(to='topologie.Room', on_delete=django.db.models.deletion.PROTECT, blank=True)),
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('details', models.CharField(max_length=255, blank=True)),
('building', models.CharField(max_length=255, unique=True)),
('number', models.IntegerField()),
],
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topologie', '0003_room'),
]
operations = [
migrations.AlterUniqueTogether(
name='switch',
unique_together=set([('building', 'number')]),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topologie', '0004_auto_20160703_1122'),
]
operations = [
migrations.AlterUniqueTogether(
name='room',
unique_together=set([('building', 'number')]),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topologie', '0005_auto_20160703_1123'),
]
operations = [
migrations.AddField(
model_name='room',
name='room',
field=models.IntegerField(default=1),
preserve_default=False,
),
migrations.AlterField(
model_name='room',
name='building',
field=models.CharField(max_length=255),
),
migrations.AlterField(
model_name='room',
name='number',
field=models.IntegerField(blank=True),
),
migrations.AlterUniqueTogether(
name='room',
unique_together=set([('building', 'room', 'number')]),
),
]
......@@ -7,13 +7,13 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topologie', '0001_initial'),
('topologie', '0006_auto_20160703_1129'),
]
operations = [
migrations.AlterField(
model_name='room',
name='room',
field=models.CharField(unique=True, max_length=255),
name='number',
field=models.IntegerField(null=True, blank=True),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topologie', '0007_auto_20160703_1148'),
]
operations = [
migrations.AddField(
model_name='port',
name='room',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, blank=True, default=1, to='topologie.Room'),
preserve_default=False,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topologie', '0008_port_room'),
]
operations = [
migrations.AlterField(
model_name='port',
name='room',
field=models.ForeignKey(to='topologie.Room', on_delete=django.db.models.deletion.PROTECT, blank=True, null=True),
),
]
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