31 lines
799 B
Python
31 lines
799 B
Python
from django import forms
|
|
from django.urls import reverse_lazy
|
|
from django.views.generic import TemplateView
|
|
from django.views.generic.edit import CreateView
|
|
|
|
from .models import Assignment
|
|
|
|
|
|
class AssignmentForm(forms.ModelForm):
|
|
model = Assignment
|
|
coverage_from = forms.DateField(required=False)
|
|
coverage_to = forms.DateField(required=False)
|
|
|
|
|
|
class AssignmentCreateView(CreateView):
|
|
"""Show a form for the initial copyright assignment."""
|
|
|
|
form_class = AssignmentForm
|
|
fields = [
|
|
'full_name',
|
|
'email',
|
|
'place_of_residence',
|
|
'repository',
|
|
'coverage',
|
|
'attestation_of_copyright',
|
|
]
|
|
success_url = reverse_lazy('assignment-thanks')
|
|
|
|
|
|
class AssignmentThanksView(TemplateView):
|
|
template_name = 'assignment/thanks.html'
|