mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-05 14:56:24 -06:00
@@ -673,6 +673,12 @@ class RackReservation(PrimaryModel):
|
||||
verbose_name=_('units'),
|
||||
base_field=models.PositiveSmallIntegerField()
|
||||
)
|
||||
status = models.CharField(
|
||||
verbose_name=_('status'),
|
||||
max_length=50,
|
||||
choices=RackReservationStatusChoices,
|
||||
default=RackReservationStatusChoices.STATUS_ACTIVE
|
||||
)
|
||||
tenant = models.ForeignKey(
|
||||
to='tenancy.Tenant',
|
||||
on_delete=models.PROTECT,
|
||||
@@ -733,6 +739,9 @@ class RackReservation(PrimaryModel):
|
||||
def unit_list(self):
|
||||
return array_to_string(self.units)
|
||||
|
||||
def get_status_color(self):
|
||||
return RackReservationStatusChoices.colors.get(self.status)
|
||||
|
||||
def to_objectchange(self, action):
|
||||
objectchange = super().to_objectchange(action)
|
||||
objectchange.related_object = self.rack
|
||||
|
||||
Reference in New Issue
Block a user