Changeset - a2675ee029a5
[Not reviewed]
0 1 6
Ben Sturmfels (bsturmfels) - 2 years ago 2021-12-06 22:58:47
ben@sturm.com.au
Prototype copyright assignment form.
7 files changed with 62 insertions and 0 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/assignment/__init__.py
Show inline comments
 
new file 100644
www/conservancy/apps/assignment/apps.py
Show inline comments
 
new file 100644
 
from __future__ import unicode_literals
 

	
 
from django.apps import AppConfig
 

	
 

	
 
class AssignmentConfig(AppConfig):
 
    name = 'assignment'
www/conservancy/apps/assignment/migrations/__init__.py
Show inline comments
 
new file 100644
www/conservancy/apps/assignment/models.py
Show inline comments
 
new file 100644
 
from __future__ import unicode_literals
 

	
 
from django.db import models
 

	
 

	
 
class Assignment(models.Model):
 
    full_name = models.CharField(max_length=255)
 
    email = models.EmailField()
 
    place_of_residence = models.TextField(
 
        'Country of citizenship or residential address',
 
        blank=True)
 

	
 
    repository = models.URLField(
 
        'Code repository',
 
        blank=True,
 
    )
 
    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'),
 
        ],
 
        default='up to this year',
 
    )
 
    attestation_of_copyright = models.BooleanField(
 
        'I attest that I own the copyright on these works'
 
    )
www/conservancy/apps/assignment/urls.py
Show inline comments
 
new file 100644
 
from django.conf.urls import url
 

	
 
from .views import AssignmentCreateView
 

	
 

	
 
urlpatterns = [
 
    url(r'add/', AssignmentCreateView.as_view(), name='assignement-add'),
 
]
www/conservancy/apps/assignment/views.py
Show inline comments
 
new file 100644
 
from django.shortcuts import render
 

	
 

	
 
from django.urls import reverse_lazy
 
from django.views.generic.edit import CreateView, DeleteView, UpdateView
 
from .models import Assignment
 

	
 

	
 
class AssignmentCreateView(CreateView):
 
    model = Assignment
 
    fields = [
 
        'full_name',
 
        'email',
 
        'place_of_residence',
 
        'repository',
 
        'coverage',
 
        'attestation_of_copyright',
 
    ]
www/conservancy/urls.py
Show inline comments
...
 
@@ -59,4 +59,5 @@ urlpatterns = [
 
    url(r'^coming-soon.html', static_views.index),
 
    url(r'^fundraiser_data', fundgoal_views.view),
 
    url(r'^ccs-upload/', include('conservancy.apps.ccs_upload.urls', namespace='ccs_upload')),
 
    url(r'^assignment', include('conservancy.apps.assignment.urls')),
 
]
0 comments (0 inline, 0 general)