|
|
@ -611,16 +611,19 @@ class Building(AclMixin, RevMixin, models.Model): |
|
|
"""Returns all ap of the building""" |
|
|
"""Returns all ap of the building""" |
|
|
return AccessPoint.all_ap_in(self) |
|
|
return AccessPoint.all_ap_in(self) |
|
|
|
|
|
|
|
|
@cached_property |
|
|
def get_name(self): |
|
|
def cached_name(self): |
|
|
|
|
|
return self.__str__() |
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
|
if Dormitory.objects.count() > 1: |
|
|
if Dormitory.objects.count() > 1: |
|
|
return self.dormitory.name + " : " + self.name |
|
|
return self.dormitory.name + " : " + self.name |
|
|
else: |
|
|
else: |
|
|
return self.name |
|
|
return self.name |
|
|
|
|
|
|
|
|
|
|
|
@cached_property |
|
|
|
|
|
def cached_name(self): |
|
|
|
|
|
return self.get_name() |
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
|
return self.cached_name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Port(AclMixin, RevMixin, models.Model): |
|
|
class Port(AclMixin, RevMixin, models.Model): |
|
|
""" Definition d'un port. Relié à un switch(foreign_key), |
|
|
""" Definition d'un port. Relié à un switch(foreign_key), |
|
|
|