summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhusudan.C.S2011-07-24 17:55:38 +0530
committerMadhusudan.C.S2011-07-24 18:19:51 +0530
commitb67bb3a46a8da5c435a90babd0e03ec6811f08f5 (patch)
tree46e0ac6bab0a6801b5c28d692750d4930adcce42
parentfb26440bdf425a69edac4714da726b1a30195b15 (diff)
downloadpytask-b67bb3a46a8da5c435a90babd0e03ec6811f08f5.tar.gz
pytask-b67bb3a46a8da5c435a90babd0e03ec6811f08f5.tar.bz2
pytask-b67bb3a46a8da5c435a90babd0e03ec6811f08f5.zip
Get rid of the function in the utils.py for path upload path and also the previously added field in TaskComment model.
-rwxr-xr-xpytask/taskapp/models.py8
-rw-r--r--pytask/taskapp/utils.py34
2 files changed, 4 insertions, 38 deletions
diff --git a/pytask/taskapp/models.py b/pytask/taskapp/models.py
index 3d290e7..b8cc9aa 100755
--- a/pytask/taskapp/models.py
+++ b/pytask/taskapp/models.py
@@ -23,15 +23,18 @@ __authors__ = [
'"Nishanth Amuluru" <nishanth@fossee.in>',
]
+
from datetime import datetime
+import os
+
+from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
import tagging
from tagging.fields import TagField
-from utils import get_file_path
TASK_STATUS_CHOICES = (
("Unpublished", "Unpublished"),
@@ -48,8 +51,6 @@ TB_STATUS_CHOICES = (
("All tasks have users selected", "All tasks have users selected"),
("Completed", "Completed"))
-UPLOADS_DIR = "/pytask/static/uploads"
-
class Task(models.Model):
@@ -108,7 +109,6 @@ class TaskComment(models.Model):
task = models.ForeignKey('Task', related_name="comments")
data = models.TextField(verbose_name='Comment')
- file = models.FileField(verbose_name='Upload Your file', upload_to=get_file_path, null=True)
commented_by = models.ForeignKey(User,
related_name="commented_taskcomments")
diff --git a/pytask/taskapp/utils.py b/pytask/taskapp/utils.py
deleted file mode 100644
index 963b169..0000000
--- a/pytask/taskapp/utils.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011 Authors of PyTask.
-#
-# This file is part of PyTask.
-#
-# PyTask is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# PyTask is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with PyTask. If not, see <http://www.gnu.org/licenses/>.
-
-
-__authors__ = [
- '"Madhusudan.C.S" <madhusudancs@fossee.in>',
- '"Nishanth Amuluru" <nishanth@fossee.in>',
- '"Parth buch" <parth@fossee.in>',
- ]
-
-
-
-
-import os
-def get_file_path(instance, filename):
- if instance.task.parent:
- path='%d/%d' % (instance.task.parent.id, instance.task.id)
- return os.path.join('pytask', path, filename)