mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:03:10 +00:00
short_name method for machine
This commit is contained in:
parent
eca223cdc4
commit
7b53ed7578
2 changed files with 5 additions and 4 deletions
|
@ -190,6 +190,11 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
|
||||||
"que les vôtres")
|
"que les vôtres")
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def short_name(self):
|
||||||
|
return str(self.interface_set.first().domain.name)
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Machine, self).__init__(*args, **kwargs)
|
super(Machine, self).__init__(*args, **kwargs)
|
||||||
self.field_permissions = {
|
self.field_permissions = {
|
||||||
|
|
|
@ -127,10 +127,6 @@ class AccessPoint(AclMixin, Machine):
|
||||||
switchbay__switch=self.switch()
|
switchbay__switch=self.switch()
|
||||||
)
|
)
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def short_name(self):
|
|
||||||
return str(self.interface_set.first().domain.name)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def all_ap_in(cls, building_instance):
|
def all_ap_in(cls, building_instance):
|
||||||
"""Get a building as argument, returns all ap of a building"""
|
"""Get a building as argument, returns all ap of a building"""
|
||||||
|
|
Loading…
Reference in a new issue