From 6f465f28cd681c3fd9418f9edd7e91ec238ffbb2 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 13 Oct 2017 13:29:52 -0400 Subject: Updated migrations, removed comments, and changed the model from one to one to foreign key to allow for multiple documents per load --- app/dispatch/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/dispatch/models.py') 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 -- cgit v1.2.3