diff options
-rwxr-xr-x | pytask/taskapp/models.py | 8 | ||||
-rw-r--r-- | pytask/taskapp/utils.py | 34 |
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) |