--- 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']