the upload of attachments works correctly now deprecated
authorNishanth Amuluru <nishanth@fossee.in>
Thu, 06 Jan 2011 12:08:36 +0530
changeset 226 b4a3ec34c061
parent 225 042dabb73a22
child 235 e338eaeccad7
the upload of attachments works correctly now
taskapp/models.py
taskapp/views/task.py
--- a/taskapp/models.py	Thu Jan 06 11:54:57 2011 +0530
+++ b/taskapp/models.py	Thu Jan 06 12:08:36 2011 +0530
@@ -171,7 +171,7 @@
     
 class WorkReport(models.Model):
 
-    attachment = models.FileField(upload_to=UPLOADS_DIR)
+    attachment = models.FileField(upload_to=IMAGES_DIR)
     remarks = models.TextField()
     revision = models.PositiveIntegerField(default=0)
     task = models.ForeignKey(Task, related_name = "%(class)s_report")
--- a/taskapp/views/task.py	Thu Jan 06 11:54:57 2011 +0530
+++ b/taskapp/views/task.py	Thu Jan 06 12:08:36 2011 +0530
@@ -69,7 +69,7 @@
         form = WorkReportForm(request.POST, request.FILES)
 
         if form.is_valid():
-            r = WorkReport(attachment = form.cleaned_data['remarks'],
+            r = WorkReport(attachment = form.cleaned_data['attachment'],
                            remarks = form.cleaned_data['remarks'],
                            revision = old_reports.count(),
                            task = task,