mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 20:03:11 +00:00
Pretty name
This commit is contained in:
parent
d0239a1613
commit
d069baf100
3 changed files with 14 additions and 2 deletions
|
@ -635,6 +635,8 @@ class IpList(models.Model):
|
||||||
|
|
||||||
class Service(models.Model):
|
class Service(models.Model):
|
||||||
""" Definition d'un service (dhcp, dns, etc)"""
|
""" Definition d'un service (dhcp, dns, etc)"""
|
||||||
|
PRETTY_NAME = "Services à générer (dhcp, dns, etc)"
|
||||||
|
|
||||||
service_type = models.CharField(max_length=255, blank=True, unique=True)
|
service_type = models.CharField(max_length=255, blank=True, unique=True)
|
||||||
min_time_regen = models.DurationField(
|
min_time_regen = models.DurationField(
|
||||||
default=timedelta(minutes=1),
|
default=timedelta(minutes=1),
|
||||||
|
@ -682,6 +684,8 @@ def regen(service):
|
||||||
|
|
||||||
class Service_link(models.Model):
|
class Service_link(models.Model):
|
||||||
""" Definition du lien entre serveurs et services"""
|
""" Definition du lien entre serveurs et services"""
|
||||||
|
PRETTY_NAME = "Relation entre service et serveur"
|
||||||
|
|
||||||
service = models.ForeignKey('Service', on_delete=models.CASCADE)
|
service = models.ForeignKey('Service', on_delete=models.CASCADE)
|
||||||
server = models.ForeignKey('Interface', on_delete=models.CASCADE)
|
server = models.ForeignKey('Interface', on_delete=models.CASCADE)
|
||||||
last_regen = models.DateTimeField(auto_now_add=True)
|
last_regen = models.DateTimeField(auto_now_add=True)
|
||||||
|
@ -711,6 +715,8 @@ class Service_link(models.Model):
|
||||||
|
|
||||||
class OuverturePortList(models.Model):
|
class OuverturePortList(models.Model):
|
||||||
"""Liste des ports ouverts sur une interface."""
|
"""Liste des ports ouverts sur une interface."""
|
||||||
|
PRETTY_NAME = "Profil d'ouverture de ports"
|
||||||
|
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
help_text="Nom de la configuration des ports.",
|
help_text="Nom de la configuration des ports.",
|
||||||
max_length=255
|
max_length=255
|
||||||
|
@ -757,6 +763,8 @@ class OuverturePort(models.Model):
|
||||||
|
|
||||||
On limite les ports entre 0 et 65535, tels que défini par la RFC
|
On limite les ports entre 0 et 65535, tels que défini par la RFC
|
||||||
"""
|
"""
|
||||||
|
PRETTY_NAME = "Plage de port ouverte"
|
||||||
|
|
||||||
TCP = 'T'
|
TCP = 'T'
|
||||||
UDP = 'U'
|
UDP = 'U'
|
||||||
IN = 'I'
|
IN = 'I'
|
||||||
|
|
|
@ -129,6 +129,7 @@ class Switch(models.Model):
|
||||||
|
|
||||||
class ModelSwitch(models.Model):
|
class ModelSwitch(models.Model):
|
||||||
"""Un modèle (au sens constructeur) de switch"""
|
"""Un modèle (au sens constructeur) de switch"""
|
||||||
|
PRETTY_NAME = "Modèle de switch"
|
||||||
reference = models.CharField(max_length=255)
|
reference = models.CharField(max_length=255)
|
||||||
constructor = models.ForeignKey(
|
constructor = models.ForeignKey(
|
||||||
'topologie.ConstructorSwitch',
|
'topologie.ConstructorSwitch',
|
||||||
|
@ -141,6 +142,7 @@ class ModelSwitch(models.Model):
|
||||||
|
|
||||||
class ConstructorSwitch(models.Model):
|
class ConstructorSwitch(models.Model):
|
||||||
"""Un constructeur de switch"""
|
"""Un constructeur de switch"""
|
||||||
|
PRETTY_NAME = "Constructeur de switch"
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
@ -182,7 +182,7 @@ class User(AbstractBaseUser):
|
||||||
""" Definition de l'utilisateur de base.
|
""" Definition de l'utilisateur de base.
|
||||||
Champs principaux : name, surnname, pseudo, email, room, password
|
Champs principaux : name, surnname, pseudo, email, room, password
|
||||||
Herite du django BaseUser et du système d'auth django"""
|
Herite du django BaseUser et du système d'auth django"""
|
||||||
PRETTY_NAME = "Utilisateurs"
|
PRETTY_NAME = "Utilisateurs (clubs et adhérents)"
|
||||||
STATE_ACTIVE = 0
|
STATE_ACTIVE = 0
|
||||||
STATE_DISABLED = 1
|
STATE_DISABLED = 1
|
||||||
STATE_ARCHIVE = 2
|
STATE_ARCHIVE = 2
|
||||||
|
@ -255,7 +255,7 @@ class User(AbstractBaseUser):
|
||||||
def class_name(self):
|
def class_name(self):
|
||||||
"""Renvoie si il s'agit d'un adhérent ou d'un club"""
|
"""Renvoie si il s'agit d'un adhérent ou d'un club"""
|
||||||
if hasattr(self, 'adherent'):
|
if hasattr(self, 'adherent'):
|
||||||
return "Adhérent"
|
return "Adherent"
|
||||||
elif hasattr(self, 'club'):
|
elif hasattr(self, 'club'):
|
||||||
return "Club"
|
return "Club"
|
||||||
else:
|
else:
|
||||||
|
@ -733,6 +733,7 @@ class User(AbstractBaseUser):
|
||||||
|
|
||||||
|
|
||||||
class Adherent(User):
|
class Adherent(User):
|
||||||
|
PRETTY_NAME = "Adhérents"
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
room = models.OneToOneField(
|
room = models.OneToOneField(
|
||||||
'topologie.Room',
|
'topologie.Room',
|
||||||
|
@ -744,6 +745,7 @@ class Adherent(User):
|
||||||
|
|
||||||
|
|
||||||
class Club(User):
|
class Club(User):
|
||||||
|
PRETTY_NAME = "Clubs"
|
||||||
room = models.ForeignKey(
|
room = models.ForeignKey(
|
||||||
'topologie.Room',
|
'topologie.Room',
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
|
|
Loading…
Reference in a new issue