admin.py 2.26 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 39 40
from .models import (
    Port,
    Room,
    Switch,
    Stack,
    ModelSwitch,
    ConstructorSwitch,
    Borne
)
41

42

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

47

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

52

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

57

58 59 60 61 62
class BorneAdmin(VersionAdmin):
    """Administration d'une borne"""
    pass


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

67

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


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


chirac's avatar
chirac committed
78
admin.site.register(Port, PortAdmin)
79
admin.site.register(Borne, BorneAdmin)
chirac's avatar
chirac committed
80
admin.site.register(Room, RoomAdmin)
chirac's avatar
chirac committed
81
admin.site.register(Switch, SwitchAdmin)
82
admin.site.register(Stack, StackAdmin)
83 84
admin.site.register(ModelSwitch, ModelSwitchAdmin)
admin.site.register(ConstructorSwitch, ConstructorSwitchAdmin)