Fix defaults, will close #3

Moved to template now model as it both fixed the bug and consolidated edit points
This commit is contained in:
Johnathan Graydon
2019-01-13 16:30:45 +00:00
parent 2717133d1c
commit 7478068a14
2 changed files with 10 additions and 4 deletions

View File

@@ -42,10 +42,10 @@ class BaseAsset(models.Model):
asset_id = models.CharField(max_length=10)
description = models.CharField(max_length=120)
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE, default='Active')
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
serial_number = models.CharField(max_length=150, blank=True)
purchased_from = models.ForeignKey(to=Supplier, on_delete=models.CASCADE, blank=True, null=True)
date_acquired = models.DateField(default=datetime.date.today().strftime('%d %b %Y'))
date_acquired = models.DateField()
date_sold = models.DateField(blank=True, null=True)
purchase_price = models.DecimalField(blank=True, null=True, decimal_places=2, max_digits=10)
salvage_value = models.DecimalField(blank=True, null=True, decimal_places=2, max_digits=10)