taskapp/forms/task.py
changeset 21 c28774fe7ffd
parent 18 a39549bd5b08
child 22 36d3173ab7f9
equal deleted inserted replaced
20:ec7b1751c161 21:c28774fe7ffd
     4 class TaskCreateForm(forms.ModelForm):
     4 class TaskCreateForm(forms.ModelForm):
     5     class Meta:
     5     class Meta:
     6         model = Task
     6         model = Task
     7         fields = ['title', 'desc', 'tags', 'credits']
     7         fields = ['title', 'desc', 'tags', 'credits']
     8     publish = forms.BooleanField(required=False)
     8     publish = forms.BooleanField(required=False)
       
     9 
       
    10 def AddMentorForm(choices,instance=None):
       
    11     """ return a form object with appropriate choices """
       
    12     
       
    13     class myform(forms.Form):
       
    14         mentor = forms.ChoiceField(choices=choices, required=True)
       
    15     form = myform(instance=instance) if instance else myform()
       
    16     return form
       
    17 
       
    18 def ClaimTaskForm(models.ModelForm):
       
    19     class Meta:
       
    20         model = Claim
       
    21         fields = ['message']