mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Change supplier and abstract model to match the design agreed in the office.
This commit is contained in:
@@ -1,13 +1,34 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
import reversion
|
import reversion
|
||||||
|
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
class Suppliers(models.Model):
|
class Suppliers(models.Model):
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
address = models.TextField()
|
|
||||||
phone = models.CharField(max_length=13, null=True, blank=True)
|
|
||||||
company_number = models.IntegerField()
|
|
||||||
|
|
||||||
class AbstractAsset(object):
|
|
||||||
purchase_cost = models.DecimalField(max_digits=10, decimal_places=2)
|
class AbstractAsset(models.Model):
|
||||||
purchase_date = models.DateField(blank=True, null=True)
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user