summaryrefslogtreecommitdiff
path: root/taskapp/forms
diff options
context:
space:
mode:
authornishanth2010-02-25 02:11:49 +0530
committernishanth2010-02-25 02:11:49 +0530
commita4dc314c81b55b37e0d7cb251890cef53d95cc80 (patch)
tree8c755b840e3eb0e5b2737ed660f72185a5f8d47b /taskapp/forms
parent8e977c480e3e8e80a73a1638710fd5758913a4ba (diff)
downloadpytask-a4dc314c81b55b37e0d7cb251890cef53d95cc80.tar.gz
pytask-a4dc314c81b55b37e0d7cb251890cef53d95cc80.tar.bz2
pytask-a4dc314c81b55b37e0d7cb251890cef53d95cc80.zip
added the capability of adding subtasks/dependencies .
Diffstat (limited to 'taskapp/forms')
-rw-r--r--taskapp/forms/task.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/taskapp/forms/task.py b/taskapp/forms/task.py
index 1bcdc6f..d3cea32 100644
--- a/taskapp/forms/task.py
+++ b/taskapp/forms/task.py
@@ -27,3 +27,17 @@ def AssignTaskForm(choices, instance=None):
user = forms.ChoiceField(choices=choices, required=True)
form = myform()
return form
+
+def AddTaskForm(task_choices, is_plain=False):
+ """ if is_plain is true, it means the task has no subs/deps.
+ so we also give a radio button to choose between subs and dependencies.
+ else we only give choices.
+ """
+
+ class myForm(forms.Form):
+ if is_plain:
+ type_choices = [('S','Subtasks'),('D','Dependencies')]
+ type = forms.ChoiceField(type_choices, widget=forms.RadioSelect)
+
+ task = forms.MultipleChoiceField(choices=task_choices)
+ return myForm()