admin.py 2.73 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
    AccessPoint,
    SwitchBay,
Fernet Laouen's avatar
Fernet Laouen committed
41 42
    Building,
    PortProfile,
43
)
44

45

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

50

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

55

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

60

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


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

70

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


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


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

Fernet Laouen's avatar
Fernet Laouen committed
90 91 92
class PortProfileAdmin(VersionAdmin):
    """Administration of a port profile"""
    pass
93

chirac's avatar
chirac committed
94
admin.site.register(Port, PortAdmin)
95
admin.site.register(AccessPoint, AccessPointAdmin)
chirac's avatar
chirac committed
96
admin.site.register(Room, RoomAdmin)
chirac's avatar
chirac committed
97
admin.site.register(Switch, SwitchAdmin)
98
admin.site.register(Stack, StackAdmin)
99 100
admin.site.register(ModelSwitch, ModelSwitchAdmin)
admin.site.register(ConstructorSwitch, ConstructorSwitchAdmin)
101 102
admin.site.register(Building, BuildingAdmin)
admin.site.register(SwitchBay, SwitchBayAdmin)
Fernet Laouen's avatar
Fernet Laouen committed
103
admin.site.register(PortProfile, PortProfileAdmin)