aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/models.py
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-10-13 13:29:52 -0400
committerMitch Riedstra <Mitch@riedstra.us>2017-10-13 13:29:52 -0400
commit6f465f28cd681c3fd9418f9edd7e91ec238ffbb2 (patch)
tree83a1cdac2a0d1ba892a190ff5cd037e8ddbf2dc7 /app/dispatch/models.py
parent6fd0dd3c9cc397cf6b498854bd10cbc2eb8c73d7 (diff)
downloaddispatch-tracker-6f465f28cd681c3fd9418f9edd7e91ec238ffbb2.tar.gz
dispatch-tracker-6f465f28cd681c3fd9418f9edd7e91ec238ffbb2.tar.xz
Updated migrations, removed comments, and changed the model from one to one to foreign key to allow for multiple documents per load
Diffstat (limited to 'app/dispatch/models.py')
-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 acb13cd..13b4e8b 100644
--- a/app/dispatch/models.py
+++ b/app/dispatch/models.py
@@ -26,12 +26,13 @@ class Load(models.Model):
return "{c}, {d} ( {a} )".format(c=self.company, d=self.description, a=self.amount)
class Paperwork(models.Model):
- load = models.OneToOneField(Load)
+ load = models.ForeignKey(Load, on_delete=models.CASCADE)
description = models.CharField(max_length=256)
+ filename = models.CharField(max_length=256)
document = models.FileField(upload_to='paperwork/')
def __str__(self):
- return "%s" % Load
+ return "%s" % self.load