admin.py 2.58 KB
Newer Older
1
# -*- mode: python; coding: utf-8 -*-
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017  Gabriel Détraz
# Copyright © 2017  Goulven Kermarec
# Copyright © 2017  Augustin Lemesle
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 24 25
"""
Fichier définissant les administration des models dans l'interface admin
"""
26

27
from __future__ import unicode_literals
chirac's avatar
chirac committed
28 29

from django.contrib import admin
30
from reversion.admin import VersionAdmin
chirac's avatar
chirac committed
31

32 33 34 35 36 37 38
from .models import (
    Port,
    Room,
    Switch,
    Stack,
    ModelSwitch,
    ConstructorSwitch,
39 40 41
    AccessPoint,
    SwitchBay,
    Building
42
)
43

44

45
class StackAdmin(VersionAdmin):
46
    """Administration d'une stack de switches (inclus des switches)"""
Gabriel Detraz's avatar
Gabriel Detraz committed
47
    pass
chirac's avatar
chirac committed
48

49

50
class SwitchAdmin(VersionAdmin):
51
    """Administration d'un switch"""
Gabriel Detraz's avatar
Gabriel Detraz committed
52
    pass
chirac's avatar
chirac committed
53

54

55
class PortAdmin(VersionAdmin):
56
    """Administration d'un port de switches"""
Gabriel Detraz's avatar
Gabriel Detraz committed
57
    pass
chirac's avatar
chirac committed
58

59

60
class AccessPointAdmin(VersionAdmin):
61 62 63 64
    """Administration d'une borne"""
    pass


65
class RoomAdmin(VersionAdmin):
66
    """Administration d'un chambre"""
Gabriel Detraz's avatar
Gabriel Detraz committed
67
    pass
chirac's avatar
chirac committed
68

69

70 71 72 73 74 75 76 77 78 79
class ModelSwitchAdmin(VersionAdmin):
    """Administration d'un modèle de switch"""
    pass


class ConstructorSwitchAdmin(VersionAdmin):
    """Administration d'un constructeur d'un switch"""
    pass


80 81 82 83 84 85 86 87 88 89
class SwitchBayAdmin(VersionAdmin):
    """Administration d'une baie de brassage"""
    pass


class BuildingAdmin(VersionAdmin):
    """Administration d'un batiment"""
    pass


chirac's avatar
chirac committed
90
admin.site.register(Port, PortAdmin)
91
admin.site.register(AccessPoint, AccessPointAdmin)
chirac's avatar
chirac committed
92
admin.site.register(Room, RoomAdmin)
chirac's avatar
chirac committed
93
admin.site.register(Switch, SwitchAdmin)
94
admin.site.register(Stack, StackAdmin)
95 96
admin.site.register(ModelSwitch, ModelSwitchAdmin)
admin.site.register(ConstructorSwitch, ConstructorSwitchAdmin)
97 98
admin.site.register(Building, BuildingAdmin)
admin.site.register(SwitchBay, SwitchBayAdmin)