Commit e86bb986 authored by jocelyn's avatar jocelyn

Affiche un matériel avec ses identifiants

Sinon, il est trop difficile de distinguer plusieurs hardwares du même modèle.

Ref #189 190
parent 3712b6ed
......@@ -75,6 +75,14 @@ class Item(models.Model):
objects = ItemQuerySet().as_manager()
def __unicode__(self):
if self.serial and self.mac_address:
return '{} ({} / {})'.format(
self.designation, self.mac_address, self.serial
elif self.serial or self.mac_address:
return '{} ({})'.format(
self.designation, self.mac_address or self.serial
return self.designation
def save(self, *args, **kwargs):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment