pytask/taskapp/forms/task.py
changeset 14 f2623fb8041a
parent 11 d28fcc644fbb
child 15 c6038cbf8a39
--- a/pytask/taskapp/forms/task.py	Sat Jan 30 13:10:11 2010 +0530
+++ b/pytask/taskapp/forms/task.py	Mon Feb 01 11:10:29 2010 +0530
@@ -6,3 +6,16 @@
         model = Task
         fields = ['title', 'desc', 'tags', 'credits']
     publish = forms.BooleanField(required=False)
+
+def AddMentorForm(choices,instance=None):
+    """ return a form object with appropriate choices """
+    
+    class myform(forms.Form):
+        mentor = forms.ChoiceField(choices=choices, required=True)
+    form = myform(instance=instance) if instance else myform()
+    return form
+
+def ClaimTaskForm(models.ModelForm):
+    class Meta:
+        model = Claim
+        fields = ['message']