equal
deleted
inserted
replaced
1 from django import forms |
1 from django import forms |
2 from pytask.taskapp.models import Task |
2 from pytask.taskapp.models import Task, Claim |
3 |
3 |
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'] |
13 class myform(forms.Form): |
13 class myform(forms.Form): |
14 mentor = forms.ChoiceField(choices=choices, required=True) |
14 mentor = forms.ChoiceField(choices=choices, required=True) |
15 form = myform(instance=instance) if instance else myform() |
15 form = myform(instance=instance) if instance else myform() |
16 return form |
16 return form |
17 |
17 |
18 def ClaimTaskForm(models.ModelForm): |
18 class ClaimTaskForm(forms.ModelForm): |
19 class Meta: |
19 class Meta: |
20 model = Claim |
20 model = Claim |
21 fields = ['message'] |
21 fields = ['message'] |