mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 22:42:17 +00:00
Allow two decimal places in cable length, show training item IDs in selectpicker
Will close #540
This commit is contained in:
18
assets/migrations/0028_alter_asset_length.py
Normal file
18
assets/migrations/0028_alter_asset_length.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.19 on 2023-05-24 22:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assets', '0027_asset_nickname'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='asset',
|
||||
name='length',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, help_text='m', max_digits=10, null=True),
|
||||
),
|
||||
]
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user