Commit d48b3a9c authored by Hamza Dely's avatar Hamza Dely

Ajout d'un champ pour la gestion de la configuration PoE des switches

parent 80b2901e
......@@ -3,7 +3,10 @@ from models import Prise
from reversion.admin import VersionAdmin
class PriseAdmin(VersionAdmin):
list_display = ('__unicode__', 'crans', 'prise_crans', 'crous', 'prise_crous', 'has_radius', 'public', 'commentaire')
list_display = (
'__unicode__', 'crans', 'prise_crans', 'crous', 'prise_crous',
'has_radius', 'public', 'poe_status', 'commentaire',
)
list_display_links = ('__unicode__',)
list_editable = ('commentaire',)
list_filter = ('batiment', 'cablage_effectue', 'crans', 'crous')
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 21:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('prises', '0003_auto_20170130_2139'),
]
operations = [
migrations.AddField(
model_name='prise',
name='poe_status',
field=models.CharField(blank=True, choices=[(b'critical', b'Critique'), (b'high', b'Haute'), (b'low', b'Basse'), (b'', b'D\xc3\xa9sactiv\xc3\xa9')], default=b'', max_length=256, verbose_name=b'Statut PoE / Priorit\xc3\xa9'),
),
]
......@@ -62,6 +62,17 @@ CUSTOM_HEADERS = {
class Prise(models.Model):
POE_CRITICAL = "critical"
POE_HIGH = "high"
POE_LOW = "low"
POE_DISABLED = ""
POE_LEVELS = (
(POE_CRITICAL, "Critique"),
(POE_HIGH, "Haute"),
(POE_LOW, "Basse"),
(POE_DISABLED, "Désactivé"),
)
class Meta:
ordering = ["batiment", "chambre"]
permissions = (
......@@ -79,6 +90,10 @@ class Prise(models.Model):
commentaire = models.CharField(max_length=1024, blank=True, null=True)
public = models.BooleanField(default=False)
has_radius = models.BooleanField(default=True)
poe_status = models.CharField(
max_length=256, blank=True, choices=POE_LEVELS,
default=POE_DISABLED, verbose_name="Statut / Priorité PoE"
)
cablage_effectue = models.BooleanField(default=True)
def toggle(self):
......
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