taskapp/forms/task.py
changeset 21 c28774fe7ffd
parent 18 a39549bd5b08
child 22 36d3173ab7f9
--- a/taskapp/forms/task.py	Thu Feb 04 22:34:22 2010 +0530
+++ b/taskapp/forms/task.py	Thu Feb 04 22:37:15 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']