Le serveur gitlab sera inaccessible le mercredi 19 février 2020 de 13h à 14h pour une intervention de maintenance programmée.

Commit 7b53ed75 authored by Charlie Jacomme's avatar Charlie Jacomme

short_name method for machine

parent eca223cd
......@@ -190,6 +190,11 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
"que les vôtres")
return True, None
@cached_property
def short_name(self):
return str(self.interface_set.first().domain.name)
def __init__(self, *args, **kwargs):
super(Machine, self).__init__(*args, **kwargs)
self.field_permissions = {
......
......@@ -127,10 +127,6 @@ class AccessPoint(AclMixin, Machine):
switchbay__switch=self.switch()
)
@cached_property
def short_name(self):
return str(self.interface_set.first().domain.name)
@classmethod
def all_ap_in(cls, building_instance):
"""Get a building as argument, returns all ap of a building"""
......
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