add a customer property to the Warranty and Backup model
This commit is contained in:
parent
9b8af679ed
commit
463e25010b
|
@ -30,6 +30,10 @@ class Backup(models.Model):
|
|||
def __str__(self):
|
||||
return str(self.name)
|
||||
|
||||
@property
|
||||
def customer(self):
|
||||
return self.computer.customer
|
||||
|
||||
|
||||
class TargetDevice(models.Model):
|
||||
device = models.ForeignKey(Computer, models.SET_NULL, blank=True,
|
||||
|
|
|
@ -23,3 +23,7 @@ class Warranty(models.Model):
|
|||
|
||||
class Meta:
|
||||
verbose_name_plural = "Warranties"
|
||||
|
||||
@property
|
||||
def customer(self):
|
||||
return self.device.customer
|
||||
|
|
Loading…
Reference in New Issue