From 8b2aaa0c0eb28e26b8d8be60a6a07dfba47f2bfa Mon Sep 17 00:00:00 2001 From: Tom Price Date: Tue, 15 Sep 2015 17:52:50 +0100 Subject: [PATCH] Add some suggestions for asset category choices. This is a lot more complex than it needs to be due to somebody wanting to be clever in the past and making asset numbers dependant upon the category they are in. --- assets/models.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/assets/models.py b/assets/models.py index 381a7519..98f342da 100644 --- a/assets/models.py +++ b/assets/models.py @@ -32,3 +32,40 @@ class AbstractAsset(models.Model): class Meta: abstract = True + + +class Asset(models.Model): + CATEGORY_GENERAL = 1 + CATEGORY_CASE = 2 + CATEGORY_COMMS = 3 + CATEGORY_DECKING = 4 + CATEGORY_OFFICE = 5 + CATEGORY_SOUND = 10 + CATEGORY_LIGHTING = 20 + CATEGORY_VIDEO = 30 + CATEGORY_RIGGING = 40 + CATEGORY_TRUSS = 41 + CATEGORY_LADDERS = 42 + CATEGORY_POWER = 50 + CATEGORY_DISTRO = 51 + + CATEGORY_CHOICES = ( + (CATEGORY_SOUND, 'Sound'), + (CATEGORY_LIGHTING, 'Lighting'), + ('Other', ( + (CATEGORY_GENERAL, 'General'), + (CATEGORY_CASE, 'Case'), + (CATEGORY_COMMS, 'Comms'), + (CATEGORY_DECKING, 'Decking'), + (CATEGORY_OFFICE, 'Office'), + )), + + ) + + name = models.CharField(max_length=255) + serial_number = models.CharField(max_length=255) + date_acquired = models.DateField(null=True, blank=True) + date_sold = models.DateField(null=True, blank=True) + purchase_price = models.DecimalField(max_digits=10, decimal_places=2) + replacement_price = models.DecimalField(max_digits=10, decimal_places=2) +