mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-30 20:02:16 +00:00
@@ -1,6 +1,8 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
class AssetCategory(models.Model):
|
class AssetCategory(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -40,10 +42,10 @@ class BaseAsset(models.Model):
|
|||||||
asset_id = models.CharField(max_length=10)
|
asset_id = models.CharField(max_length=10)
|
||||||
description = models.CharField(max_length=120)
|
description = models.CharField(max_length=120)
|
||||||
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
|
category = models.ForeignKey(to=AssetCategory, on_delete=models.CASCADE)
|
||||||
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE)
|
status = models.ForeignKey(to=AssetStatus, on_delete=models.CASCADE, default='Active')
|
||||||
serial_number = models.CharField(max_length=150, blank=True)
|
serial_number = models.CharField(max_length=150, blank=True)
|
||||||
purchased_from = models.ForeignKey(to=Supplier, on_delete=models.CASCADE, blank=True, null=True)
|
purchased_from = models.ForeignKey(to=Supplier, on_delete=models.CASCADE, blank=True, null=True)
|
||||||
date_acquired = models.DateField()
|
date_acquired = models.DateField(default=datetime.date.today().strftime('%d %b %Y'))
|
||||||
date_sold = models.DateField(blank=True, null=True)
|
date_sold = models.DateField(blank=True, null=True)
|
||||||
purchase_price = models.DecimalField(blank=True, null=True, decimal_places=2, max_digits=10)
|
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)
|
salvage_value = models.DecimalField(blank=True, null=True, decimal_places=2, max_digits=10)
|
||||||
|
|||||||
Reference in New Issue
Block a user