diff --git a/lelcsc/core/models/component.py b/lelcsc/core/models/component.py index 0ce960b..e910096 100644 --- a/lelcsc/core/models/component.py +++ b/lelcsc/core/models/component.py @@ -23,8 +23,8 @@ class Property(models.Model): ) def __str__(self): - return ( - self.name + f" [{self.unit}]" if self.type == Property.Type.QUANTITY else "" + return self.name + ( + f" [{self.unit}]" if self.type == Property.Type.QUANTITY else "" ) @@ -48,13 +48,13 @@ class Value(models.Model): def __str__(self): match self.property.type: case Property.Type.QUANTITY: - s = str(integer) + s = str(self.integer) scale = self.property.scale if scale > 0: s += "0" * scale elif scale < 0: - s = str(integer).rjust(abs(scale) + 1, "0") + s = str(self.integer).rjust(abs(scale) + 1, "0") s = s[:scale] + "." + s[scale:] return f"{s} {self.property.unit}"