Changeset - 2b1fd9ab90d9
[Not reviewed]
0 3 0
Ben Sturmfels (bsturmfels) - 7 months ago 2021-12-06 22:59:40
ben@sturm.com.au
Add assignment date range.
3 files changed with 17 insertions and 4 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/models.py
Show inline comments
...
 
@@ -4,6 +4,8 @@ from django.db import models
 

	
 

	
 
class Assignment(models.Model):
 
    """A copyright assignment to Conservancy."""
 

	
 
    full_name = models.CharField(max_length=255)
 
    email = models.EmailField()
 
    place_of_residence = models.TextField(
...
 
@@ -20,9 +22,12 @@ class Assignment(models.Model):
 
        choices=[
 
            ('up to this year', 'One-off up to and including this year'),
 
            ('ongoing', 'All existing and new contributions'),
 
            ('specific', 'A specific period (details below)'),
 
        ],
 
        default='up to this year',
 
    )
 
    coverage_from = models.DateField(blank=True)
 
    coverage_to = models.DateField(blank=True)
 
    attestation_of_copyright = models.BooleanField(
 
        'I attest that I own the copyright on these works'
 
    )
www/conservancy/apps/assignment/views.py
Show inline comments
 
from django.shortcuts import render
 

	
 
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 AssignmentCreateView(CreateView):
 
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',
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -33,6 +33,6 @@
 

	
 
    <p><em>Please be aware that some employment agreements explicitly transfer copyright ownership to the employer. We recommend you review your recent employment agreements for such clauses.</em></p>
 

	
 
    <p><button type="submit" class="ph3 pv2">Next</button>
 
    <p><button type="submit" class="ph3 pv2">Next</button></p>
 
  </form>
 
{% endblock %}
0 comments (0 inline, 0 general)