pytask/taskapp/forms/task.py
changeset 14 f2623fb8041a
parent 11 d28fcc644fbb
child 15 c6038cbf8a39
equal deleted inserted replaced
13:4da58abdf6ff 14:f2623fb8041a
     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']