taskapp/forms/task.py
changeset 92 c99f09bebe56
parent 91 1b5ad4b7c40e
child 93 1a1e712e60fd
equal deleted inserted replaced
91:1b5ad4b7c40e 92:c99f09bebe56
    18 class ClaimTaskForm(forms.ModelForm):
    18 class ClaimTaskForm(forms.ModelForm):
    19     class Meta:
    19     class Meta:
    20         model = Claim
    20         model = Claim
    21         fields = ['message']
    21         fields = ['message']
    22 
    22 
    23 def ChoiceForm(choices, instance=None):
    23 def ChoiceForm(choices):
    24     """ return a form object with appropriate choices """
    24     """ return a form object with appropriate choices """
    25     
    25     
    26     class myform(forms.Form):
    26     class myform(forms.Form):
    27         user = forms.ChoiceField(choices=choices, required=True)
    27         choice = forms.ChoiceField(choices=choices, required=True)
    28     form = myform()
    28     form = myform()
    29     return form
    29     return form
    30 
    30 
    31 def AddTaskForm(task_choices, is_plain=False):
    31 def AddTaskForm(task_choices, is_plain=False):
    32     """ if is_plain is true, it means the task has no subs/deps.
    32     """ if is_plain is true, it means the task has no subs/deps.