--- a/pytask/taskapp/forms.py Sun Jan 09 11:51:48 2011 +0530
+++ b/pytask/taskapp/forms.py Sun Jan 09 11:52:09 2011 +0530
@@ -77,6 +77,14 @@
raise forms.ValidationError('Enter something as a proposal')
return data
+def ChoiceForm(choices, data=None):
+ """ return a form object with appropriate choices """
+
+ class myform(forms.Form):
+ choice = forms.ChoiceField(choices=choices, required=True)
+ form = myform(data) if data else myform()
+ return form
+
def AddReviewerForm(choices,instance=None):
""" return a form object with appropriate choices """
@@ -85,16 +93,6 @@
form = myform(instance) if instance else myform()
return form
-
-
-def ChoiceForm(choices, instance=None):
- """ return a form object with appropriate choices """
-
- class myform(forms.Form):
- choice = forms.ChoiceField(choices=choices, required=True)
- form = myform(instance) if instance else 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.