1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#6454 add prerequisite alert

This commit is contained in:
Arthur
2022-08-18 13:58:40 -07:00
parent 7a44a4e305
commit eb3d3dcbc4
9 changed files with 62 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from collections import OrderedDict
from django.apps import apps
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType
@ -202,6 +203,10 @@ class Rack(NetBoxModel):
return f'{self.name} ({self.facility_id})'
return self.name
@classmethod
def get_prerequisite_models(cls):
return [apps.get_model('dcim.Site'), ]
def get_absolute_url(self):
return reverse('dcim:rack', args=[self.pk])