now task can have a title of a deleted task.
authornishanth
Tue, 02 Mar 2010 02:25:28 +0530
changeset 166 ac72d641046e
parent 165 8ea5bcf3bd01
child 167 b61e45074ba1
now task can have a title of a deleted task.
taskapp/events/task.py
taskapp/models.py
taskapp/views/task.py
--- a/taskapp/events/task.py	Tue Mar 02 02:12:57 2010 +0530
+++ b/taskapp/events/task.py	Tue Mar 02 02:25:28 2010 +0530
@@ -119,7 +119,7 @@
             break
 
     try:
-        task = Task.objects.get(title__iexact=title)
+        task = Task.objects.exclude(status="DL").get(title__iexact=title)
         return None
     except:
         task = Task(title=title)
--- a/taskapp/models.py	Tue Mar 02 02:12:57 2010 +0530
+++ b/taskapp/models.py	Tue Mar 02 02:25:28 2010 +0530
@@ -95,7 +95,7 @@
     title = models.CharField(max_length = 100, verbose_name = u"Title", help_text = u"Keep it simple and below 100 chars.")
     desc = models.TextField(verbose_name = u"Description")
     status = models.CharField(max_length = 2, choices = STATUS_CHOICES, default = "UP")
-    tags_field = TagField()
+    tags_field = TagField() ## must be named some thing decent later on
     
     credits = models.PositiveSmallIntegerField()
     progress = models.PositiveSmallIntegerField(default = 0)
--- a/taskapp/views/task.py	Tue Mar 02 02:12:57 2010 +0530
+++ b/taskapp/views/task.py	Tue Mar 02 02:25:28 2010 +0530
@@ -132,7 +132,7 @@
                     title = data['title']
                     desc = data['desc']
                     credits = data['credits']
-                    publish = data['publish']
+                    #publish = data['publish'] # just in case if we have to show the option
                     task = createTask(title,desc,user,credits)
                     
                     if not task:
@@ -537,7 +537,7 @@
                 data = form.cleaned_data
                 title = data['title']
                 try:
-                    prev_task = Task.objects.get(title=title)
+                    prev_task = Task.objects.exclude(status="DL").get(title=title)
                     if prev_task != task:
                         error_msg = "Another task exists with the same title"
                         return render_to_response('task/edittask.html',{'user':user, 'form':form, 'error_msg':error_msg})
@@ -556,9 +556,6 @@
     else:
         return show_msg(user, "You cannot edit the task at this stage", task_url, "view the task")
 
-
-
-
 def complete_task(request, tid):
     """ call the event called complete task.
     and also pass it the current user to know who marked it as complete.