Allow two decimal places in cable length, show training item IDs in selectpicker

Will close #540
This commit is contained in:
2023-05-24 23:05:04 +01:00
parent 01fe242172
commit 35def0e921
4 changed files with 27 additions and 4 deletions

View File

@@ -135,7 +135,7 @@ class Asset(models.Model, RevisionMixin):
# Cable assets
is_cable = models.BooleanField(default=False)
cable_type = models.ForeignKey(to=CableType, blank=True, null=True, on_delete=models.SET_NULL)
length = models.DecimalField(decimal_places=1, max_digits=10,
length = models.DecimalField(decimal_places=2, max_digits=10,
blank=True, null=True, help_text='m')
csa = models.DecimalField(decimal_places=2, max_digits=10,
blank=True, null=True, help_text='mm²')
@@ -192,5 +192,5 @@ class Asset(models.Model, RevisionMixin):
return str(self.asset_id)
@property
def name(self):
def display_name(self):
return f"{self.display_id} | {self.description}"