Change supplier and abstract model to match the design agreed in the office.

This commit is contained in:
Tom Price
2015-09-15 17:25:11 +01:00
parent 5cdc75ce5c
commit b1952b96f7

View File

@@ -1,13 +1,34 @@
from django.db import models
import reversion
# Create your models here.
class Suppliers(models.Model):
name = models.CharField(max_length=100)
address = models.TextField()
phone = models.CharField(max_length=13, null=True, blank=True)
company_number = models.IntegerField()
name = models.CharField(max_length=100)
class AbstractAsset(object):
purchase_cost = models.DecimalField(max_digits=10, decimal_places=2)
purchase_date = models.DateField(blank=True, null=True)
class AbstractAsset(models.Model):
STATUS_LOST = 1
STATUS_ACTIVE = 2
STATUS_INACTIVE = 3
STATUS_BROKEN = 4
STATUS_SCRAPPED = 5
STATUS_NOT_BUILT = 6
STATUS_SOLD = 7
STATUS_CHOICES = (
(STATUS_LOST, 'Lost'),
(STATUS_ACTIVE, 'Active'),
(STATUS_INACTIVE, 'Inactive'),
(STATUS_BROKEN, 'Broken'),
(STATUS_SCRAPPED, 'Scrapped'),
(STATUS_NOT_BUILT, 'Not Yet Built'),
(STATUS_SOLD, 'Sold'),
)
status = models.IntegerField(choices=STATUS_CHOICES)
notes = models.TextField(blank=True, null=True)
# test_period # decide what to do with this later
class Meta:
abstract = True