aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2017-10-18 22:23:45 -0400
committerMitch Riedstra <mitch@riedstra.us>2017-10-18 22:23:45 -0400
commitce72b1fd9ca4136c0894d826dd5b20153e57c537 (patch)
treea7270c2ff5ebf1741369a85a61742e12f0b0eb91 /app
parent6eafb1557bbe8838390d233f21c3831b8a9e05d0 (diff)
downloaddispatch-tracker-ce72b1fd9ca4136c0894d826dd5b20153e57c537.tar.gz
dispatch-tracker-ce72b1fd9ca4136c0894d826dd5b20153e57c537.tar.xz
Add history fields to the models for "easy access"
Diffstat (limited to 'app')
-rw-r--r--app/dispatch/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/dispatch/models.py b/app/dispatch/models.py
index 62af763..8c7cd7d 100644
--- a/app/dispatch/models.py
+++ b/app/dispatch/models.py
@@ -1,12 +1,14 @@
from django.db import models
from django.conf import settings
from auditlog.registry import auditlog
+from auditlog.models import AuditlogHistoryField
import uuid
# Create your models here.
class Company(models.Model):
+ history = AuditlogHistoryField()
name = models.CharField(max_length=256)
address = models.CharField(max_length=256)
phone_number = models.DecimalField(max_digits=16,decimal_places=0)
@@ -17,6 +19,7 @@ class Company(models.Model):
return self.name
class Load(models.Model):
+ history = AuditlogHistoryField()
load_number = models.CharField(max_length=64,default="")
date = models.DateField()
user = models.ForeignKey(settings.AUTH_USER_MODEL)
@@ -33,8 +36,6 @@ class Load(models.Model):
return "/loads/view/%i" % self.id
-
-
# This is used to set the upload path of the document for Paperwork Objects
def paperwork_user_directory_path(instance, filename):
# We don't want the UUID to be too long, just enough so there aren't any