Changeset - 2b1fd9ab90d9
[Not reviewed]
0 3 0
Ben Sturmfels (bsturmfels) - 2 years 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
 
from __future__ import unicode_literals
 

	
 
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(
 
        'Country of citizenship or residential address',
 
        blank=True)
 

	
...
 
@@ -17,12 +19,15 @@ class Assignment(models.Model):
 
    coverage = models.CharField(
 
        verbose_name='Time period to assign',
 
        max_length=50,
 
        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',
 
        'place_of_residence',
 
        'repository',
 
        'coverage',
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -30,9 +30,9 @@
 
  <form action="." method="post" class="mw7">
 
    {% csrf_token %}
 
    {{ form.as_p }}
 

	
 
    <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)