diff --git a/asset/models.py b/asset/models.py index 396be05..ab40d8f 100644 --- a/asset/models.py +++ b/asset/models.py @@ -24,6 +24,9 @@ class Asset(models.Model): def get_absolute_url(self): return reverse('asset:detail', kwargs={'pk': self.pk}) + def __str__(self): + return self.named_id + ' (' + str(self.quantity) + '): ' + self.description + class GtinProduct(models.Model): gtin = models.CharField(max_length=40, unique=True) @@ -33,3 +36,6 @@ class GtinProduct(models.Model): brand = models.CharField(max_length=40, blank=True) created_ts = models.DateTimeField('datetime created', auto_now_add=True) changed_ts = models.DateTimeField('datetime updated', auto_now=True) + + def __str__(self): + return self.gtin + ': ' + self.name diff --git a/booker/models.py b/booker/models.py index fb7ea0e..af42c54 100644 --- a/booker/models.py +++ b/booker/models.py @@ -16,3 +16,6 @@ class Scanner(models.Model): changed_ts = models.DateTimeField('datetime updated', auto_now=True) changed_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET(get_deleted_user), related_name='changed_scanners') + + def __str__(self): + return self.named_id + ': ' + self.description + ' (' + str(self.last_online_ts) + ')'