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
...
 
@@ -6,2 +6,4 @@ from django.db import models
 
class Assignment(models.Model):
 
    """A copyright assignment to Conservancy."""
 

	
 
    full_name = models.CharField(max_length=255)
...
 
@@ -22,2 +24,3 @@ class Assignment(models.Model):
 
            ('ongoing', 'All existing and new contributions'),
 
            ('specific', 'A specific period (details below)'),
 
        ],
...
 
@@ -25,2 +28,4 @@ class Assignment(models.Model):
 
    )
 
    coverage_from = models.DateField(blank=True)
 
    coverage_to = models.DateField(blank=True)
 
    attestation_of_copyright = models.BooleanField(
www/conservancy/apps/assignment/views.py
Show inline comments
 
from django.shortcuts import render
 

	
 
from django import forms
 
from django.urls import reverse_lazy
...
 
@@ -5,2 +4,3 @@ from django.views.generic import TemplateView
 
from django.views.generic.edit import CreateView
 

	
 
from .models import Assignment
...
 
@@ -8,4 +8,12 @@ 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 = [
www/conservancy/templates/assignment/assignment_form.html
Show inline comments
...
 
@@ -35,3 +35,3 @@
 

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