index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
55,021 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/comments/utils.py | from django.contrib import messages
from django.shortcuts import redirect, render
from django.urls import reverse
from comments.forms.attachment import AttachmentForm
from comments.forms.comment import CommentForm
def comments_attachments_forms(submit_viewname, parent):
context = {}
if parent.comment_object():
context[CommentForm.FORM_NAME] = CommentForm(form_action=reverse(submit_viewname,
kwargs={'pk': parent.id}),
category_queryset=parent.comment_object().category_queryset(),
prefix=CommentForm.FORM_NAME)
if parent.attachment_object():
context[AttachmentForm.FORM_NAME] = AttachmentForm(form_action=reverse(submit_viewname,
kwargs={'pk': parent.id}),
category_queryset=parent.attachment_object().category_queryset(),
prefix=AttachmentForm.FORM_NAME)
context['comments'] = list(parent.comments())
context['comments_reversed'] = context['comments'][::-1]
context['attachments'] = list(parent.attachments())
context['attachments_reversed'] = context['attachments'][::-1]
return context
def process_comment_attachment(request, context, submit_viewname, submit_viewname_repost, form_with_errors_template,
parent):
proposal_attachment_form = None
if 'comment_form_submit' in request.POST:
proposal_comment_form = CommentForm(request.POST, form_action=reverse(submit_viewname,
kwargs={'pk': parent.id}),
prefix=CommentForm.FORM_NAME,
category_queryset=parent.comment_object().category_queryset())
if parent.attachment_object():
proposal_attachment_form = AttachmentForm(form_action=reverse(submit_viewname,
kwargs={'pk': parent.id}),
category_queryset=parent.attachment_object().category_queryset(),
prefix=AttachmentForm.FORM_NAME)
if proposal_comment_form.is_valid():
proposal_comment_form.save(parent, request.user)
messages.success(request, 'Comment saved')
return redirect(reverse(submit_viewname, kwargs={'pk': parent.id}))
else:
messages.error(request, 'Error saving the comment. Check the information in the comments section.')
elif 'attachment_form_submit' in request.POST:
proposal_comment_form = CommentForm(form_action=reverse(submit_viewname_repost,
kwargs={'pk': parent.id}),
prefix=CommentForm.FORM_NAME,
category_queryset=parent.comment_object().category_queryset())
proposal_attachment_form = AttachmentForm(request.POST, request.FILES,
form_action=reverse(submit_viewname_repost,
kwargs={'pk': parent.id}),
category_queryset=parent.attachment_object().category_queryset(),
prefix=AttachmentForm.FORM_NAME)
if proposal_attachment_form.is_valid():
if proposal_attachment_form.save(parent, request.user):
messages.success(request, 'Attachment saved')
return redirect(reverse(submit_viewname, kwargs={'pk': parent.id}))
else:
messages.error(request, 'Error saving attachment. Try again please.')
else:
assert False
if proposal_comment_form is not None:
context[AttachmentForm.FORM_NAME] = proposal_attachment_form
context[CommentForm.FORM_NAME] = proposal_comment_form
return render(request, form_with_errors_template, context)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,022 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0030_template_question_answer_max_length_positive_only.py | # Generated by Django 2.2.6 on 2019-10-11 14:11
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('project_core', '0029_gender_can_be_null'),
]
operations = [
migrations.CreateModel(
name='PersonUid',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uid', models.CharField(help_text='Unique identifier', max_length=150, null=True)),
('date_created', models.DateTimeField(default=django.utils.timezone.now, help_text='Date and time at which this UID was created')),
('person', models.OneToOneField(help_text='Person to which the UID refers', on_delete=django.db.models.deletion.PROTECT, to='project_core.PhysicalPerson')),
],
options={
'abstract': False,
},
),
migrations.AlterField(
model_name='callquestion',
name='answer_max_length',
field=models.PositiveIntegerField(blank=True, help_text='Maximum number of words that can be specified to the answer of a question', null=True),
),
migrations.AlterField(
model_name='source',
name='source',
field=models.CharField(help_text='Source from which a UID may originate', max_length=100),
),
migrations.AlterField(
model_name='templatequestion',
name='answer_max_length',
field=models.PositiveIntegerField(blank=True, help_text='Maximum number of words that can be specified to the answer of a question', null=True),
),
migrations.DeleteModel(
name='PersonUuid',
),
migrations.AddField(
model_name='personuid',
name='source',
field=models.ForeignKey(help_text='Source of the UID', on_delete=django.db.models.deletion.PROTECT, to='project_core.Source'),
),
migrations.AlterUniqueTogether(
name='personuid',
unique_together={('uid', 'source')},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,023 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/templatetags/request_is_management.py | from django import template
from ProjectApplication import settings
from project_core.utils.utils import user_is_in_group_name
register = template.Library()
@register.filter(name='request_is_management')
def request_is_management(request):
return user_is_in_group_name(request.user, settings.MANAGEMENT_GROUP_NAME)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,024 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/tests/forms/test_media.py | from datetime import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from grant_management.forms.media import MediumModelForm
from grant_management.models import Medium, License
from project_core.tests import database_population
class MediumModelFormTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
def test_medium_valid(self):
file = SimpleUploadedFile('photography.jpg',
b'This should contain a JPEG for example.')
license, _ = License.objects.get_or_create(name='Creative Commons', spdx_identifier='cc')
data = {'project': self._project,
'received_date': datetime(2020, 1, 1),
'photographer': self._project.principal_investigator.person,
'license': license
}
file = {'file': file}
self.assertEqual(Medium.objects.all().count(), 0)
medium_form = MediumModelForm(data=data, files=file, project=self._project)
self.assertTrue(medium_form.is_valid())
medium_form.save()
self.assertEqual(Medium.objects.all().count(), 1)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,025 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0002_proposal_models.py | # Generated by Django 2.2.4 on 2019-09-20 09:18
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('project_core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='BudgetCategory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Name of the budget category', max_length=100)),
('description', models.CharField(help_text='Description of the budget category', max_length=300)),
],
),
migrations.CreateModel(
name='Contact',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email_address', models.CharField(help_text='Email address', max_length=100)),
('work_telephone', models.CharField(help_text='Work telephone number', max_length=20)),
('mobile', models.CharField(blank=True, help_text='Mobile telephone number', max_length=20, null=True)),
],
),
migrations.CreateModel(
name='Country',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Country name', max_length=100)),
],
),
migrations.CreateModel(
name='FundingStatus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status', models.CharField(help_text='Name of the status', max_length=30)),
('description', models.CharField(help_text='Decsription of the status', max_length=100)),
],
),
migrations.CreateModel(
name='GeographicArea',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('area', models.CharField(help_text='Name of geograpic area', max_length=100)),
('definition', models.CharField(help_text='Detailed description of the geographic area to avoid duplicate entries or confusion', max_length=300)),
],
),
migrations.CreateModel(
name='Keyword',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Name of a keyword', max_length=128)),
('description', models.CharField(help_text='Decsription of a keyword that should be used to distinguish it from another keyword', max_length=512)),
],
),
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('message_type', models.CharField(choices=[('CI', 'Call introductory message')], help_text='Identification of where the message is to be used', max_length=5)),
('message', models.TextField(help_text='Text of the message')),
],
),
migrations.CreateModel(
name='Organisation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('long_name', models.CharField(help_text='Full name by which the organisation is known', max_length=100)),
('short_name', models.CharField(blank=True, help_text='Short name by which the organisation is commonly known', max_length=50, null=True)),
('address', models.CharField(blank=True, help_text='Address of the organisation', max_length=1000, null=True)),
('country', models.ForeignKey(help_text='Country in which the organisation is based', on_delete=django.db.models.deletion.PROTECT, to='project_core.Country')),
],
),
migrations.CreateModel(
name='Person',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(help_text='First name(s) of a person', max_length=100)),
('surname', models.CharField(help_text='Last name(s) of a person', max_length=100)),
('group', models.CharField(blank=True, help_text='Name of the working group, department, laboratory for which the person works', max_length=200, null=True)),
],
),
migrations.CreateModel(
name='PersonTitle',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(help_text='Personal or academic title used by a person', max_length=50)),
],
),
migrations.CreateModel(
name='Proposal',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(help_text='Title of the proposal being submitted', max_length=1000)),
('location', models.CharField(blank=True, help_text='More precise location of where proposal would take place (not coordinates)', max_length=200, null=True)),
('start_time_frame', models.CharField(help_text='Approximate date on which the proposed project is expected to start', max_length=100)),
('duration', models.CharField(help_text='Period of time expected that the proposed project will last', max_length=100)),
('summary', models.TextField(help_text='Summary of the proposal submitted for funding')),
('description', models.TextField(help_text='Outline of proposal')),
('requested_funds_explanation', models.TextField(help_text='Explanation about how proposed funds would be used')),
('logistics_requirements', models.TextField(help_text='Description of requirements regarding logistics and local partners')),
('applicant', models.ForeignKey(help_text='Main applicant of the proposal', on_delete=django.db.models.deletion.PROTECT, to='project_core.Person')),
('geographical_area', models.ForeignKey(help_text='Description of the geographical area covered by the proposal', on_delete=django.db.models.deletion.PROTECT, to='project_core.GeographicArea')),
('keywords', models.ManyToManyField(help_text='Keywords that describe the topic of the proposal', to='project_core.Keyword')),
],
),
migrations.CreateModel(
name='ProposalFundingItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.DecimalField(decimal_places=2, help_text='Amount given in funding', max_digits=10)),
('organisation', models.ForeignKey(help_text='Name of organisation from which the funding is sourced', on_delete=django.db.models.deletion.PROTECT, to='project_core.Organisation')),
('proposal', models.ForeignKey(help_text='Proposal for which the funding has been sourced', on_delete=django.db.models.deletion.PROTECT, to='project_core.Proposal')),
('status', models.ForeignKey(help_text='Status of the funding item', on_delete=django.db.models.deletion.PROTECT, to='project_core.FundingStatus')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='ProposalStatus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Name of the status of the proposal table', max_length=50)),
('description', models.CharField(help_text='Detailed description of the proposal status name', max_length=512)),
],
),
migrations.CreateModel(
name='ProposedBudgetItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('details', models.TextField()),
('amount', models.DecimalField(decimal_places=2, help_text='Cost of category item', max_digits=10, null=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='project_core.BudgetCategory')),
('proposal', models.ForeignKey(help_text='Proposal it which the budget item relates', on_delete=django.db.models.deletion.PROTECT, to='project_core.Proposal')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Step',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Name of a step', max_length=60)),
('description', models.CharField(help_text='Description of a step', max_length=200)),
],
),
migrations.CreateModel(
name='StepDate',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(help_text='Date and time of notable date', max_length=64)),
('step', models.ForeignKey(help_text='Name of step', max_length=128, on_delete=django.db.models.deletion.PROTECT, to='project_core.Step')),
],
),
migrations.RemoveField(
model_name='call',
name='dates',
),
migrations.AddField(
model_name='call',
name='budget_maximum',
field=models.DecimalField(decimal_places=2, default=0, help_text='Maximum amount that can be requested in the proposal budget', max_digits=10),
preserve_default=False,
),
migrations.AddField(
model_name='call',
name='call_open_date',
field=models.DateTimeField(default=django.utils.timezone.now, help_text='Date on which the call is opened'),
preserve_default=False,
),
migrations.AddField(
model_name='call',
name='introductory_message',
field=models.TextField(blank=True, help_text='Introductory text to the call for applicants', null=True),
),
migrations.AddField(
model_name='call',
name='submission_deadline',
field=models.DateTimeField(default=django.utils.timezone.now, help_text='Submission deadline of the call'),
preserve_default=False,
),
migrations.AlterField(
model_name='call',
name='long_name',
field=models.CharField(help_text='Full name of the call', max_length=200),
),
migrations.AlterField(
model_name='call',
name='short_name',
field=models.CharField(blank=True, help_text='Short name or acronym of the call', max_length=60, null=True),
),
migrations.DeleteModel(
name='Date',
),
migrations.AddField(
model_name='proposal',
name='proposal_status',
field=models.ForeignKey(help_text='Status or outcome of the proposal', on_delete=django.db.models.deletion.PROTECT, to='project_core.ProposalStatus'),
),
migrations.AddField(
model_name='person',
name='academic_title',
field=models.ForeignKey(help_text='Title of the person', on_delete=django.db.models.deletion.PROTECT, to='project_core.PersonTitle'),
),
migrations.AddField(
model_name='person',
name='organisation',
field=models.ManyToManyField(help_text='Organisation(s) represented by the person', to='project_core.Organisation'),
),
migrations.AddField(
model_name='contact',
name='person',
field=models.ForeignKey(help_text='Person to which the contact details belong', on_delete=django.db.models.deletion.PROTECT, to='project_core.Person'),
),
migrations.AddField(
model_name='call',
name='budget_categories',
field=models.ManyToManyField(help_text='Categories required for the budget for a call', to='project_core.BudgetCategory'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,026 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0140_migrate_budget_categories.py | from django.db import migrations, models, connection
def create_budget_category_calls(apps, schema_editor):
BudgetCategoryCall = apps.get_model('project_core', 'BudgetCategoryCall')
Call = apps.get_model('project_core', 'Call')
for call in Call.objects.all():
order_number = 1
with connection.cursor() as cursor:
# Raw SQL needed: The models in models.py might not have the fields (as they are removed at a later point)
cursor.execute('''SELECT budgetcategory_id, name, project_core_budgetcategory.order FROM
project_core_call_budget_categories
LEFT JOIN project_core_budgetcategory
ON project_core_call_budget_categories.budgetcategory_id=project_core_budgetcategory.id
WHERE call_id=%s ORDER BY project_core_budgetcategory.order ASC, name ASC''', [call.id])
for row in cursor.fetchall():
budget_category_id = row[0]
BudgetCategoryCall.objects.create(call=call, budget_category_id=budget_category_id, order=order_number)
order_number += 1
def enable_all_budget_categories(apps, schema_editor):
BudgetCategoryCall = apps.get_model('project_core', 'BudgetCategoryCall')
BudgetCategoryCall.objects.all().update(enabled=True)
class Migration(migrations.Migration):
dependencies = [
('project_core', '0139_budgetcategorycall_sortable'),
]
operations = [
migrations.RunPython(create_budget_category_calls),
migrations.RemoveField(
model_name='call',
name='budget_categories',
),
migrations.AddField(
model_name='budgetcategorycall',
name='enabled',
field=models.BooleanField(default=False, help_text='Appears in the proposal form'),
),
migrations.RunPython(enable_all_budget_categories),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,027 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0107_historicalcall_historicalcontact_historicalfundinginstrument_historicalpersonposition_historicalphys.py | # Generated by Django 3.0.3 on 2020-02-27 09:46
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0106_removes_created_by'),
]
operations = [
migrations.CreateModel(
name='HistoricalPhysicalPerson',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
('first_name', models.CharField(help_text='First name(s) of a person', max_length=100)),
('surname', models.CharField(help_text='Last name(s) of a person', max_length=100)),
('phd_date', models.CharField(blank=True, help_text='Date (yyyy-mm) on which PhD awarded or expected', max_length=20, null=True, validators=[django.core.validators.RegexValidator(code='Invalid format', message='Format is yyyy-mm', regex='^[0-9]{4}-[0-9]{2}$')])),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('gender', models.ForeignKey(blank=True, db_constraint=False, help_text='Gender with which the person identifies', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.Gender')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'historical physical person',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name='HistoricalPersonPosition',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
('group', models.CharField(blank=True, help_text='Name of the working group, department, laboratory for which the person works', max_length=200, null=True)),
('privacy_policy', models.BooleanField(default=False, help_text='Agree or disagree to the data policy for storage of personal information')),
('contact_newsletter', models.BooleanField(default=False, help_text='Agree or disagree to being contacted by email with newsletter')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('academic_title', models.ForeignKey(blank=True, db_constraint=False, help_text='Title of the person', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.PersonTitle')),
('career_stage', models.ForeignKey(blank=True, db_constraint=False, help_text='Stage of the person in the career', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.CareerStage')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('person', models.ForeignKey(blank=True, db_constraint=False, help_text='A unique physical person', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.PhysicalPerson')),
],
options={
'verbose_name': 'historical person position',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name='HistoricalFundingInstrument',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
('long_name', models.CharField(db_index=True, help_text='Full name of funding instrument', max_length=200)),
('short_name', models.CharField(blank=True, help_text='Short name or acronym of the funding instrument', max_length=60, null=True)),
('description', models.TextField(help_text='Description of the funding instrument that can be used to distinguish it from others')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'historical funding instrument',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name='HistoricalContact',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
('entry', models.CharField(help_text='Text of contact entry, such as phone number, pager etc.', max_length=100)),
('method', models.CharField(choices=[('Office', 'Office'), ('Mobile', 'Mobile'), ('Email', 'Email')], help_text='Type of contact method', max_length=30)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('person_position', models.ForeignKey(blank=True, db_constraint=False, help_text='Person to whom the contact details belong', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.PersonPosition')),
],
options={
'verbose_name': 'historical contact',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
migrations.CreateModel(
name='HistoricalCall',
fields=[
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
('created_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(blank=True, editable=False, help_text='Date and time at which the entry was modified', null=True)),
('long_name', models.CharField(db_index=True, help_text='Full name of the call', max_length=200)),
('short_name', models.CharField(blank=True, help_text='Short name or acronym of the call', max_length=60, null=True)),
('description', models.TextField(help_text='Description of the call that can be used to distinguish it from others')),
('introductory_message', models.TextField(blank=True, help_text='Introductory text to the call for applicants', null=True)),
('call_open_date', models.DateTimeField(help_text='Date on which the call is opened')),
('submission_deadline', models.DateTimeField(help_text='Submission deadline of the call')),
('budget_maximum', models.DecimalField(decimal_places=2, help_text='Maximum amount that can be requested in the proposal budget', max_digits=10, validators=[django.core.validators.MinValueValidator(0)])),
('other_funding_question', models.BooleanField(help_text='True if the Other Funding question is enabled')),
('proposal_partner_question', models.BooleanField(help_text='True if the Proposal Partner question is enabled')),
('overarching_project_question', models.BooleanField(default=False, help_text='True if the question for the overarching project is displayed')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('funding_instrument', models.ForeignKey(blank=True, db_constraint=False, help_text='Funding instrument to which the call belongs', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.FundingInstrument')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'historical call',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': 'history_date',
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,028 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/tests/test_views.py | import json
from datetime import date
from urllib.parse import quote_plus
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase, Client
from django.urls import reverse
from django.utils.datastructures import MultiValueDict
from ProjectApplication import settings
from grant_management.models import GrantAgreement, Installment, Invoice, LaySummaryType, LaySummary
from project_core.tests import database_population
from project_core.tests.utils_for_tests import dict_to_multivalue_dict
class ProjectListTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(reverse('logged-grant_management-project-list'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, self._project.title)
class ProjectDetailsTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-project-detail', kwargs={'pk': self._project.id}))
self.assertEqual(response.status_code, 200)
self.assertContains(response, self._project.title)
class ProjectBasicInformationUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-project-basic-information-update', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
def test_post(self):
project_id = self._project.id
self.assertEqual(self._project.start_date, date(2020, 1, 10))
self.assertEqual(self._project.end_date, date(2022, 5, 7))
data = MultiValueDict(
{'start_date': ['10-05-2020'],
'end_date': ['22-10-2020'],
'save': ['Save Information']
})
response = self._client_management.post(
reverse('logged-grant_management-project-basic-information-update', kwargs={'project': project_id}),
data=data
)
self.assertEqual(response.status_code, 302)
self._project.refresh_from_db()
self.assertEqual(self._project.start_date, date(2020, 5, 10))
self.assertEqual(self._project.end_date, date(2020, 10, 22))
class GrantAgreementAddViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-grant_agreement-add', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
def test_post(self):
project_id = self._project.id
signed_by_id = self._project.principal_investigator.person.id
self.assertFalse(hasattr(self._project, 'grantagreement'))
data = MultiValueDict(
{'project': [str(project_id)],
'signed_by': [str(signed_by_id)],
'signed_date': ['01-05-2020'],
'file': [SimpleUploadedFile('grant_agreement.pdf',
b'This is the signed grant agreement. C.')]
})
response = self._client_management.post(
reverse('logged-grant_management-grant_agreement-add', kwargs={'project': project_id}),
data=data
)
self.assertEqual(response.status_code, 302)
self._project.refresh_from_db()
self.assertTrue(hasattr(self._project, 'grantagreement'))
grant_agreement = self._project.grantagreement
self.assertEqual(grant_agreement.signed_date, date(2020, 5, 1))
self.assertEqual(list(grant_agreement.signed_by.all()), [self._project.principal_investigator.person])
self.assertTrue(grant_agreement.file.name != '')
class ProjectUpdateTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-project-update', kwargs={'pk': self._project.id})
)
self.assertEqual(response.status_code, 200)
class GrantAgreementUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
grant_agreement = GrantAgreement(project=self._project)
grant_agreement.save()
response = self._client_management.get(
reverse('logged-grant_management-grant_agreement-update', kwargs={'pk': self._project.grantagreement.id})
)
self.assertEqual(response.status_code, 200)
class LaySummariesRawTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
def test_get(self):
c = Client()
response = c.get(reverse('lay-summaries-for_website', kwargs={'call': self._project.call.id}))
self.assertEqual(response.status_code, 200)
class BlogPostsUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-blog_posts-update', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
class InstallmentsUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-installments-update', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
def test_post_valid(self):
data = dict_to_multivalue_dict({'FORM_SET-TOTAL_FORMS': 1,
'FORM_SET-INITIAL_FORMS': 0,
'FORM_SET-MIN_NUM_FORMS': 1,
'FORM_SET-MAX_NUM_FORMS': 1000,
'FORM_SET-0-project': self._project.id,
'FORM_SET-0-id': '',
'FORM_SET-0-DELETE': '',
'FORM_SET-0-can_be_deleted': 0,
'FORM_SET-0-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-0-amount': 50
})
self.assertEqual(Installment.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-installments-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 302)
self.assertEqual(Installment.objects.all().count(), 1)
def test_post_invalid(self):
data = dict_to_multivalue_dict({'FORM_SET-TOTAL_FORMS': 2,
'FORM_SET-INITIAL_FORMS': 0,
'FORM_SET-MIN_NUM_FORMS': 1,
'FORM_SET-MAX_NUM_FORMS': 1000,
'FORM_SET-0-project': self._project.id,
'FORM_SET-0-id': '',
'FORM_SET-0-DELETE': '',
'FORM_SET-0-can_be_deleted': 0,
'FORM_SET-0-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-0-amount': 15_000,
'FORM_SET-1-project': self._project.id,
'FORM_SET-1-id': '',
'FORM_SET-1-DELETE': '',
'FORM_SET-1-can_be_deleted': 0,
'FORM_SET-1-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-1-amount': 10_000
})
self.assertEqual(Installment.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-installments-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 200)
self.assertEqual(Installment.objects.all().count(), 0)
self.assertEqual(list(response.context['messages'])[0].message,
'Installments not saved. Verify errors in the form')
class InvoicesUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-invoices-update', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
def test_post(self):
# Lay Summary Type needs to exist because during the invoice checking it does
# a lookup for the settings.LAY_SUMMARY_ORIGINAL
lay_summary_type = LaySummaryType.objects.create(name=settings.LAY_SUMMARY_ORIGINAL,
description='Original')
installment = Installment.objects.create(project=self._project,
amount=500)
data = dict_to_multivalue_dict({'FORM_SET-TOTAL_FORMS': 1,
'FORM_SET-INITIAL_FORMS': 0,
'FORM_SET-MIN_NUM_FORMS': 1,
'FORM_SET-MAX_NUM_FORMS': 1000,
'FORM_SET-0-project': self._project.id,
'FORM_SET-0-id': '',
'FORM_SET-0-DELETE': '',
'FORM_SET-0-can_be_deleted': 0,
'FORM_SET-0-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-0-amount': 50,
'FORM_SET-0-installment': installment.id
})
self.assertEqual(Invoice.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-invoices-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 302)
self.assertEqual(Invoice.objects.all().count(), 1)
def _data_two_invoices(self, installment, amount):
return dict_to_multivalue_dict({'FORM_SET-TOTAL_FORMS': 2,
'FORM_SET-INITIAL_FORMS': 0,
'FORM_SET-MIN_NUM_FORMS': 1,
'FORM_SET-MAX_NUM_FORMS': 1000,
'FORM_SET-0-project': self._project.id,
'FORM_SET-0-id': '',
'FORM_SET-0-DELETE': '',
'FORM_SET-0-can_be_deleted': 0,
'FORM_SET-0-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-0-amount': 12_000,
'FORM_SET-0-installment': installment.id,
'FORM_SET-1-project': self._project.id,
'FORM_SET-1-id': '',
'FORM_SET-1-DELETE': '',
'FORM_SET-1-can_be_deleted': 0,
'FORM_SET-1-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-1-amount': 12_000,
'FORM_SET-1-installment': installment.id,
})
def test_post_invoices_too_big(self):
lay_summary_type = LaySummaryType.objects.create(name=settings.LAY_SUMMARY_ORIGINAL,
description='Original')
installment = Installment.objects.create(project=self._project,
amount=20_000)
data = self._data_two_invoices(installment, 12_000)
self.assertEqual(Invoice.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-invoices-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'Save Force Going Overbudget')
self.assertEqual(Invoice.objects.all().count(), 0)
def test_post_invoices_too_big_force(self):
lay_summary_type = LaySummaryType.objects.create(name=settings.LAY_SUMMARY_ORIGINAL,
description='Original')
installment = Installment.objects.create(project=self._project,
amount=20_000)
data = self._data_two_invoices(installment, 12_000)
data['save_force'] = 'Save Force Going Overbudget'
self.assertEqual(Invoice.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-invoices-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 302)
self.assertEqual(Invoice.objects.all().count(), 2)
class LaySummariesUpdateViewTest(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-grant_management-lay_summaries-update', kwargs={'project': self._project.id})
)
self.assertEqual(response.status_code, 200)
def test_post(self):
# Lay Summary Type needs to exist because during the invoice checking it does
# a lookup for the settings.LAY_SUMMARY_ORIGINAL
lay_summary_type = LaySummaryType.objects.create(name=settings.LAY_SUMMARY_ORIGINAL,
description='Original')
data = dict_to_multivalue_dict({'FORM_SET-TOTAL_FORMS': 1,
'FORM_SET-INITIAL_FORMS': 0,
'FORM_SET-MIN_NUM_FORMS': 1,
'FORM_SET-MAX_NUM_FORMS': 1000,
'FORM_SET-0-project': self._project.id,
'FORM_SET-0-id': '',
'FORM_SET-0-DELETE': '',
'FORM_SET-0-can_be_deleted': 0,
'FORM_SET-0-due_date': date(2020, 5, 14).strftime('%d-%m-%Y'),
'FORM_SET-0-lay_summary_type': lay_summary_type.id
})
self.assertEqual(LaySummary.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-grant_management-lay_summaries-update', kwargs={'project': self._project.id}),
data=data
)
self.assertEqual(response.status_code, 302)
self.assertEqual(LaySummary.objects.all().count(), 1)
class TestApiListMediaView(TestCase):
def setUp(self):
self._project = database_population.create_project()
self._client = Client()
def test_get_no_api_key(self):
response = self._client.get(
f'{reverse("api-list-media-view")}?modified_since=2017-01-28T21:00:00+00:00'
)
self.assertContains(response, '"ApiKey" HTTP header is required', status_code=400)
def test_get_invalid_api_key(self):
response = self._client.get(
f'{reverse("api-list-media-view")}?modified_since=2017-01-28T21:00:00+00:00',
HTTP_ApiKey='test'
)
self.assertContains(response, 'Received ApiKey header (test) does not match settings.API_SECRET_KEY',
status_code=403)
def test_get_media_empty(self):
response = self._client.get(
f'{reverse("api-list-media-view")}?modified_since={quote_plus("2017-01-28T21:00:00+00:00")}',
HTTP_ApiKey=settings.API_SECRET_KEY
)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, b'[]')
def test_get_one_medium(self):
project = database_population.create_project()
medium = database_population.create_medium(project)
response = self._client.get(
f'{reverse("api-list-media-view")}?modified_since={quote_plus("2017-01-28T21:00:00+00:00")}',
HTTP_ApiKey=settings.API_SECRET_KEY
)
self.assertEqual(response.status_code, 200)
json_body = json.loads(response.content)
self.assertEqual(len(json_body), 1)
medium_json = json_body[0]
self.assertEqual(medium_json['license'], None)
self.assertEqual(medium_json['copyright'], medium.copyright)
self.assertEqual(medium_json['file_md5'], medium.file_md5)
self.assertEqual(medium_json['descriptive_text'], medium.descriptive_text)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,029 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py | from django.test import TestCase
from ...templatetags.filename_from_path import short_filename_from_path, filename_from_path
class OrdinalTest(TestCase):
def setUp(self):
pass
def test_short_filename_for_path(self):
self.assertEqual(short_filename_from_path('directory/test.txt'), 'test.txt')
self.assertEqual(short_filename_from_path('this/is/a/directory/This is a very long file name.pdf'),
'This is a ve…pdf')
def test_filename_from_path(self):
self.assertEqual(filename_from_path('a/b/name.txt'), 'name.txt')
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,030 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0163_add_account_number.py | # Generated by Django 3.2 on 2021-04-23 10:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0162_callpartfile_proposal_keywords_null'),
]
operations = [
migrations.AddField(
model_name='financialkey',
name='account_number',
field=models.IntegerField(help_text='Code use by the accounting department', null=True, unique=True),
),
migrations.AlterField(
model_name='call',
name='scientific_clusters_question',
field=models.BooleanField(default=False, help_text='True if the Research Cluster question is enabled'),
),
migrations.AlterField(
model_name='historicalcall',
name='scientific_clusters_question',
field=models.BooleanField(default=False, help_text='True if the Research Cluster question is enabled'),
),
migrations.AlterField(
model_name='proposalscientificcluster',
name='keywords',
field=models.ManyToManyField(help_text='Keywords that describe the research cluster', to='project_core.Keyword'),
),
migrations.AlterField(
model_name='proposalscientificcluster',
name='proposal',
field=models.ForeignKey(help_text='Proposal that this Research Cluster refers to', on_delete=django.db.models.deletion.PROTECT, to='project_core.proposal'),
),
migrations.AlterField(
model_name='proposalscientificcluster',
name='sub_pi',
field=models.ForeignKey(help_text='Main person of this research cluster', on_delete=django.db.models.deletion.PROTECT, to='project_core.personposition'),
),
migrations.AlterField(
model_name='proposalscientificcluster',
name='title',
field=models.CharField(help_text='Title of the research cluster', max_length=500),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,031 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/user.py | from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse
from django.views.generic import ListView, CreateView, DetailView, UpdateView
from evaluation.models import Reviewer
from project_core.forms.user import UserForm
from project_core.models import SpiUser
class UserListView(ListView):
template_name = 'logged/user-list.tmpl'
context_object_name = 'users'
model = SpiUser
queryset = SpiUser.objects.filter(is_superuser=False)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'user-list',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Users'}]
return context
class UserAdd(SuccessMessageMixin, CreateView):
template_name = 'logged/user-form.tmpl'
model = SpiUser
success_message = 'User created'
form_class = UserForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'user-add',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Users', 'url': reverse('logged-user-list')},
{'name': 'Create'}]
return context
def form_valid(self, form):
result = super().form_valid(form)
if form.new_password:
self.request.session['user_password_user_id'] = form.user_id_new_password
self.request.session['user_password'] = form.new_password
return result
def get_success_url(self, **kwargs):
return reverse('logged-user-detail', kwargs={'pk': self.object.pk})
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
type_of_user = self.request.GET.get('type_of_user')
if type_of_user:
kwargs['type_of_user'] = type_of_user
return kwargs
class UserDetailView(DetailView):
template_name = 'logged/user-detail.tmpl'
model = SpiUser
context_object_name = 'user'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'user-list',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Users', 'url': reverse('logged-user-list')},
{'name': 'View'}]
user_password = self.request.session.get('user_password')
user_password_id = self.request.session.get('user_password_user_id')
context['new_password'] = None
if self.object.is_reviewer():
context['physical_person'] = Reviewer.objects.get(user=self.object).person
if user_password:
if user_password_id == self.kwargs['pk']:
context['new_password'] = self.request.session['user_password']
# Changing the password on the view is horrible
# but this allows changing the user's own password and visualise it before
# the user is logged out
#
# In normal circumstances the users would have a different way to reset their own passwords
# but we are keeping the flow for resetting users other passwords or own passwords similar
# (due to time constraints for the project)
self.object.set_password(context['new_password'])
self.object.save()
if self.object == self.request.user:
messages.warning(self.request,
'Your own password has changed. You will be logged out and you will need '
'to login again with the new password.')
self.request.session['user_password'] = None
self.request.session['user_password_user_id'] = None
return context
class UserUpdate(UpdateView):
template_name = 'logged/user-form.tmpl'
model = User
success_message = 'User updated'
form_class = UserForm
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'user-list',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Users', 'url': reverse('logged-user-list')},
{'name': 'View'}]
return context
def get_success_url(self):
return reverse('logged-user-detail', kwargs={'pk': self.kwargs['pk']})
def form_valid(self, form):
result = super().form_valid(form)
if form.new_password:
self.request.session['user_password_user_id'] = form.user_id_new_password
self.request.session['user_password'] = form.new_password
return result | {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,032 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0143_proposalscientificcluster.py | # Generated by Django 3.0.10 on 2020-11-12 11:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0142_fix_physicalperson_plural'),
]
operations = [
migrations.CreateModel(
name='ProposalScientificCluster',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('title', models.CharField(help_text='Title of the scientific cluster', max_length=500)),
('applicant', models.ForeignKey(help_text='Main applicant of the proposal', on_delete=django.db.models.deletion.PROTECT, to='project_core.PersonPosition')),
('keywords', models.ManyToManyField(help_text='Keywords that describe the scientific cluster', to='project_core.Keyword')),
('proposal', models.ForeignKey(help_text='Proposal that this Scientific Cluster refers to', on_delete=django.db.models.deletion.PROTECT, to='project_core.Proposal')),
],
options={
'unique_together': {('title', 'proposal')},
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,033 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0166_organisation_long_name_english.py | # Generated by Django 3.2.3 on 2021-05-24 14:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0165_callcareerstage_enabled'),
]
operations = [
migrations.AddField(
model_name='organisation',
name='long_name_english',
field=models.CharField(blank=True, help_text='English name by which the organisation is known', max_length=100, null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,034 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0175_auto_20211203_1224.py | # Generated by Django 3.2.9 on 2021-12-03 11:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0174_spiuser'),
]
operations = [
migrations.AlterField(
model_name='historicalproject',
name='closed_on',
field=models.DateTimeField(blank=True, help_text='When the project was closed', null=True),
),
migrations.AlterField(
model_name='project',
name='closed_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='project',
name='closed_on',
field=models.DateTimeField(blank=True, help_text='When the project was closed', null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,035 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/forms/proposal.py | import datetime
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div
from dal import autocomplete
from django import forms
from django.forms import ModelForm
from django.utils.safestring import mark_safe
from django.utils.timezone import utc
from variable_templates.utils import apply_templates_to_fields
from .utils import keywords_validation
from ..fields import FlexibleDecimalField
from ..models import Proposal, Call
from ..templatetags.thousands_separator import thousands_separator
from ..widgets import XDSoftYearMonthDayPickerInput
class ProposalForm(ModelForm):
call_id = forms.IntegerField(widget=forms.HiddenInput())
duration_months = FlexibleDecimalField()
def __init__(self, *args, **kwargs):
self._call = kwargs.pop('call', None)
super().__init__(*args, **kwargs)
self.fields['keywords'].required = True
self.fields['geographical_areas'].required = True
if self._call is None:
self._call = self.instance.call
self._raise_duplicated_title = False
if self._call.overall_budget_question:
self.fields['overall_budget'] = FlexibleDecimalField(help_text = 'Approximate budget as detailed in programme description including the 5% opportunity fund', label = 'Requested overall budget (CHF)')
if self.instance.id:
self.fields['call_id'].initial = self.instance.call.id
self.fields['overall_budget'].initial = self.instance.overall_budget
call = self._call = self.instance.call
else:
self.fields['call_id'].initial = self._call.id
call = Call.objects.get(id=self._call.id)
XDSoftYearMonthDayPickerInput.set_format_to_field(self.fields['start_date'])
XDSoftYearMonthDayPickerInput.set_format_to_field(self.fields['end_date'])
self.helper = FormHelper(self)
self.helper.form_tag = False
self.fields['duration_months'].help_text = 'Expected duration of the {{ activity }} in months'
apply_templates_to_fields(self.fields, call)
divs = []
divs.append(
Div(
Div('call_id', css_class='col-12', hidden='true'),
Div('title', css_class='col-12'),
css_class='row'
)
)
divs.append(
Div(
Div('geographical_areas', css_class='col-12'),
css_class='row'
)
)
divs.append(
Div(
Div('location', css_class='col-12'),
css_class='row'
)
)
if call.keywords_in_general_information_question:
divs.append(
Div(
Div('keywords', css_class='col-12'),
css_class='row'
)
)
divs.append(
Div(
Div('start_date', css_class='col-4'),
Div('end_date', css_class='col-4'),
Div('duration_months', css_class='col-4'),
css_class='row'
)
)
if call.overall_budget_question:
divs.append(
Div(
Div('overall_budget', css_class='col-4'),
css_class='row'
)
)
self.helper.layout = Layout(*divs)
def save(self, commit=True):
self.instance.call_id = self.cleaned_data['call_id']
model = super().save(commit)
return model
def clean(self):
cleaned_data = super().clean()
errors = {}
if 'overall_budget' in cleaned_data and cleaned_data['overall_budget'] is not None:
if cleaned_data['overall_budget'] < 0:
errors['overall_budget'] = 'Budget needs to be greater than 0'
elif cleaned_data['overall_budget'] > self._call.budget_maximum:
errors['overall_budget'] = f'Budget is greater than the maximum budget for this call: ' \
f'{thousands_separator(self._call.budget_maximum)} CHF'
if self._call.keywords_in_general_information_question:
keywords_validation(errors, cleaned_data, 'keywords')
if self._raise_duplicated_title:
errors['title'] = forms.ValidationError(
mark_safe('A proposal already exists with the same title and applicant for this call. '
'Rather than starting from scratch again please use the link with which you were provided to '
'edit your application. Otherwise please contact SPI '
'<a href="mailto:grants@swisspolar.ch">grants@swisspolar.ch</a> to receive a reminder of'
' the link.'))
# Converts date to datetime objects to compare with the end of the call.
# The combine and datetime.datetime.min.time() makes it the beginning of the day
proposal_start_date = datetime.datetime.combine(cleaned_data['start_date'], datetime.datetime.min.time())
proposal_end_date = datetime.datetime.combine(cleaned_data['end_date'], datetime.datetime.min.time())
proposal_start_date = utc.localize(proposal_start_date)
proposal_end_date = utc.localize(proposal_end_date)
call_submission_deadline = self._call.submission_deadline
if proposal_end_date < proposal_start_date:
errors['start_date'] = forms.ValidationError('Proposal start date needs to be before end date')
if proposal_end_date < call_submission_deadline:
errors['end_date'] = forms.ValidationError(
'Proposal end date needs to be after call submission deadline')
if errors:
raise forms.ValidationError(errors)
return cleaned_data
def raise_duplicated_title(self):
self._raise_duplicated_title = True
self.full_clean()
class Meta:
model = Proposal
fields = ['call_id', 'title', 'geographical_areas', 'location', 'keywords', 'start_date',
'end_date', 'duration_months', 'overall_budget']
widgets = {'keywords': autocomplete.ModelSelect2Multiple(url='autocomplete-keywords'),
'geographical_areas': forms.CheckboxSelectMultiple,
'start_date': XDSoftYearMonthDayPickerInput,
'end_date': XDSoftYearMonthDayPickerInput,
}
help_texts = {
'geographical_areas': 'Select all options describing the geographical focus of this {{ activity }}',
'title': 'Name of the proposed {{ activity }}',
'location': 'More precise location of the proposed {{ activity }} (not coordinates)',
'keywords': 'Please select at least 5 keywords that describe the proposed {{ activity }}. If the keywords you are looking for do not exist, then add each term separately',
'start_date': 'Date on which the {{ activity }} to be funded by SPI, is expected to start',
'end_date': 'Date on which the {{ activity }} to be funded by SPI, is expected to end',
}
labels = {'location': 'Precise region',
'geographical_areas': 'Geographical focus'}
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,036 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/comments/tests/forms/test_comment.py | from django.test import TestCase
# dependencies of project_core could be removed - but this way is doing integration test
# as well. This can be refactored
from project_core.tests import database_population
from ...forms.comment import CommentForm
from ...models import ProposalCommentCategory, Category, ProposalComment
class CommentFormTest(TestCase):
def setUp(self):
category, _ = Category.objects.get_or_create(name='Correspondence')
self._proposal_comment_category, _ = ProposalCommentCategory.objects.get_or_create(category=category)
self._proposal = database_population.create_proposal()
def test_comment_submit(self):
comment_form = CommentForm(category_queryset=ProposalCommentCategory.objects.all(),
form_action='this-is-the-form-action')
self.assertEqual(comment_form.helper['form_action'], 'this-is-the-form-action')
def test_comment_save(self):
self.assertEqual(ProposalComment.objects.all().count(), 0)
post = {f'{CommentForm.FORM_NAME}-category': self._proposal_comment_category.id,
f'{CommentForm.FORM_NAME}-text': 'This is a comment'}
comment_form = CommentForm(post,
category_queryset=ProposalCommentCategory.objects.all(),
form_action='this-is-the-form-action',
prefix=CommentForm.FORM_NAME)
self.assertTrue(comment_form.is_valid())
comment_form.save(self._proposal, None)
self.assertEqual(ProposalComment.objects.all().count(), 1)
proposal_comment_from_db = ProposalComment.objects.all()[0]
self.assertEqual(proposal_comment_from_db.category, self._proposal_comment_category)
self.assertEqual(proposal_comment_from_db.text, 'This is a comment')
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,037 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/variable_templates/tests/test_utils.py | import unittest
from collections import OrderedDict
from django import forms
from django.test import TestCase
from project_core.tests import database_population as project_core_database_population
from . import database_population
from .. import utils
from ..models import CallVariableTemplate, TemplateVariableName, FundingInstrumentVariableTemplate
class UtilsTest(TestCase):
def setUp(self):
self._funding_instrument = project_core_database_population.create_funding_instrument()
self._call = project_core_database_population.create_call(self._funding_instrument)
database_population.delete_all_variables()
database_population.create_default_template_variables()
def test_get_template_value(self):
utils.get_template_value_for_call('activity', self._call)
def test_apply_templates_funding_from_funding_instrument(self):
template = TemplateVariableName.objects.get(name='activity')
FundingInstrumentVariableTemplate.objects.get_or_create(funding_instrument=self._funding_instrument,
name=template,
value='party')
title_field = forms.CharField(label='Name', help_text='Name of the {{ activity }}')
keywords_field = forms.CharField(label='Keywords', help_text='List the keywords')
fields = OrderedDict({'title': title_field,
'keywords': keywords_field
})
self.assertIn('{{ activity }}', fields['title'].help_text)
utils.apply_templates_to_fields(fields, self._call)
self.assertNotIn('{{ activity }}', fields['title'].help_text)
self.assertEqual('Name of the party', fields['title'].help_text)
def test_apply_templates_funding_from_call(self):
template = TemplateVariableName.objects.get(name='activity')
CallVariableTemplate.objects.get_or_create(call=self._call, name=template, value='party')
title_field = forms.CharField(label='Name', help_text='Name of the {{ activity }}')
keywords_field = forms.CharField(label='Keywords', help_text='List the keywords')
fields = OrderedDict({'title': title_field,
'keywords': keywords_field
})
self.assertIn('{{ activity }}', fields['title'].help_text)
utils.apply_templates_to_fields(fields, self._call)
self.assertNotIn('{{ activity }}', fields['title'].help_text)
self.assertEqual('Name of the party', fields['title'].help_text)
def test_apply_templates(self):
title_field = forms.CharField(label='Name', help_text='Name of the {{ activity }}')
keywords_field = forms.CharField(label='Keywords', help_text='List the keywords')
fields = OrderedDict({'title': title_field,
'keywords': keywords_field
})
self.assertIn('{{ activity }}', fields['title'].help_text)
utils.apply_templates_to_fields(fields, self._call)
self.assertNotIn('{{ activity }}', fields['title'].help_text)
self.assertEqual('Name of the proposal', fields['title'].help_text)
def get_template_value_for_funding_instrument_from_default_test(self):
activity = utils.get_template_value_for_funding_instrument('activity', self._funding_instrument)
self.assertEqual(activity, 'proposal')
def get_template_value_for_funding_instrument_from_funding_instrument(self):
template_variable_name = TemplateVariableName.objects.get(name='activity')
FundingInstrumentVariableTemplate.objects.create(name=template_variable_name,
value='dish',
funding_instrument=self._funding_instrument)
activity = utils.get_template_value_for_funding_instrument('activity', self._funding_instrument)
self.assertEqual(activity, 'dish')
def test_copy_template_variables_from_funding_instrument_to_call_test(self):
template_variable_name = TemplateVariableName.objects.get(name='activity')
FundingInstrumentVariableTemplate.objects.create(funding_instrument=self._funding_instrument,
name=template_variable_name,
value='proposal')
self.assertEqual(self._call.callvariabletemplate_set.all().count(), 0)
utils.copy_template_variables_from_funding_instrument_to_call(self._call)
self.assertEqual(self._call.callvariabletemplate_set.all().count(), 1)
self.assertTrue(self._call.callvariabletemplate_set.get(name=template_variable_name, value='proposal'))
def test_get_template_value_for_funding_instrument_test(self):
activity = utils.get_template_value_for_funding_instrument('activity', self._funding_instrument)
self.assertEqual(activity, 'proposal')
@unittest.expectedFailure
def test_get_template_value_for_funding_instrument_test_does_not_exist(self):
utils.get_template_value_for_funding_instrument('does_not_exist', self._funding_instrument)
def test_get_template_value_for_call(self):
activity = utils.get_template_value_for_call('activity', self._call)
self.assertEqual(activity, 'proposal')
@unittest.expectedFailure
def test_get_template_value_for_call_does_not_exist(self):
utils.get_template_value_for_call('does_not_exist', self._call)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,038 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0019_add_blog_post.py | # Generated by Django 3.0.5 on 2020-04-29 09:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
('grant_management', '0018_remove_laysummary_sent_date'),
]
operations = [
migrations.AlterField(
model_name='laysummary',
name='author',
field=models.ForeignKey(blank=True, help_text='Person who wrote the Lay Summary', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.PhysicalPerson'),
),
migrations.AlterField(
model_name='laysummary',
name='text',
field=models.TextField(help_text='Lay Summary text'),
),
migrations.CreateModel(
name='BlogPost',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('due_date', models.DateField(help_text='Date the document is expected to be received')),
('received_date', models.DateField(blank=True, help_text='Date the Blog post was received', null=True)),
('text', models.TextField(help_text='Blog post')),
('author', models.ForeignKey(blank=True, help_text='Person who wrote the blog post', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.PhysicalPerson')),
('project', models.ForeignKey(help_text='Abstract containing dates', on_delete=django.db.models.deletion.PROTECT, to='project_core.Project')),
],
options={
'abstract': False,
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,039 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0035_added_funding_instrument_model.py | # Generated by Django 2.2.6 on 2019-10-21 11:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0034_added_proposal_eligibility'),
]
operations = [
migrations.CreateModel(
name='FundingInstrument',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('long_name', models.CharField(help_text='Full name of funding instrument', max_length=200)),
('short_name', models.CharField(help_text='Short name or acronym of the funding instrument', max_length=60)),
('description', models.TextField(help_text='Desription of the funding instrument that can be used to distinguish it from others')),
('date_created', models.DateTimeField(default=django.utils.timezone.now, help_text='Date and time on which the funding instrument was created')),
('date_modified', models.DateTimeField(blank=True, default=django.utils.timezone.now, help_text='Date and time on which the funding instrument was modified', null=True)),
('created_by', models.ForeignKey(help_text='User id of person creating the funding instrument', on_delete=django.db.models.deletion.PROTECT, related_name='created_by_set', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(help_text='User id of person modifying the funding instrument', on_delete=django.db.models.deletion.PROTECT, related_name='modified_by_set', to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='call',
name='funding_instrument',
field=models.ForeignKey(blank=True, help_text='Funding instrument to which the call belongs', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.FundingInstrument'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,040 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0167_organisation_display_name.py | # Generated by Django 3.2.3 on 2021-06-28 09:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0166_organisation_long_name_english'),
]
operations = [
migrations.RemoveField(
model_name='organisation',
name='long_name_english',
),
migrations.AddField(
model_name='organisation',
name='display_name',
field=models.CharField(blank=True, help_text='Name of organisation used for display purposes', max_length=100, null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,041 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0013_create_proposal_partner_models.py | # Generated by Django 2.2.6 on 2019-10-04 11:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0012_proposal_uuid_unique'),
]
operations = [
migrations.CreateModel(
name='CareerStage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('stage', models.CharField(help_text='Name of career stage', max_length=50)),
('description', models.CharField(help_text='Description of the career stage', max_length=100)),
],
),
migrations.CreateModel(
name='Role',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('role', models.CharField(help_text='Name of role', max_length=50)),
('description', models.CharField(help_text='Description of role to distinguish it from others', max_length=200)),
('type', models.CharField(choices=[('Proposal', 'Proposal'), ('Project', 'Project'), ('Expedition', 'Expedition')], help_text='Part of the application to which the role refers, determining where it can be used in some cases', max_length=25)),
],
),
migrations.AlterField(
model_name='callquestion',
name='question_description',
field=models.TextField(blank=True, help_text='Description that should go alongside the question text by way of explanation for completion of answer', null=True),
),
migrations.AlterField(
model_name='callquestion',
name='question_text',
field=models.TextField(help_text='Text of a question'),
),
migrations.AlterField(
model_name='proposedbudgetitem',
name='category',
field=models.ForeignKey(help_text='Name of the budget item', on_delete=django.db.models.deletion.PROTECT, to='project_core.BudgetCategory'),
),
migrations.AlterField(
model_name='proposedbudgetitem',
name='details',
field=models.TextField(blank=True, help_text='Details of the budget item'),
),
migrations.CreateModel(
name='ProposalPartner',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('role_description', models.TextField(help_text='Description of what the person will be doing')),
('competences', models.TextField(help_text='Description of the competences of the person')),
('career_stage', models.ForeignKey(help_text='Stage of the person in the career', on_delete=django.db.models.deletion.PROTECT, to='project_core.CareerStage')),
('person', models.ForeignKey(help_text='Person that is a partner', on_delete=django.db.models.deletion.PROTECT, to='project_core.Person')),
('proposal', models.ForeignKey(help_text='Proposal to on which the partner is collaborating', on_delete=django.db.models.deletion.PROTECT, to='project_core.Proposal')),
('role', models.ForeignKey(help_text='Role of the person', on_delete=django.db.models.deletion.PROTECT, to='project_core.Role')),
],
options={
'abstract': False,
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,042 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0139_budgetcategorycall_sortable.py | # Generated by Django 3.0.10 on 2020-09-28 10:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0138_add_file_validator'),
]
operations = [
migrations.CreateModel(
name='BudgetCategoryCall',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('order', models.PositiveIntegerField(blank=True, null=True)),
('budget_category', models.ForeignKey(help_text='Budget category for this category', on_delete=django.db.models.deletion.PROTECT, to='project_core.BudgetCategory')),
('call', models.ForeignKey(help_text='Call where this category is used in', on_delete=django.db.models.deletion.PROTECT, to='project_core.Call')),
],
options={
'unique_together': {('call', 'budget_category')},
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,043 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0025_laysummarytype.py | # Generated by Django 3.0.5 on 2020-05-01 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0024_model_texts_lay_summary'),
]
operations = [
migrations.AlterField(
model_name='laysummarytype',
name='description',
field=models.CharField(help_text='Description of the type of lay summary', max_length=100),
),
migrations.AlterField(
model_name='laysummarytype',
name='name',
field=models.CharField(help_text='Type of lay summary which could be used within the application to decide how the summary is used', max_length=10, unique=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,044 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/tests/forms/test_budget.py | from django.test import TestCase
from project_core.forms.budget import BudgetItemForm
from project_core.tests import database_population
from project_core.tests.utils_for_tests import dict_to_multivalue_dict
class BudgetItemFormTest(TestCase):
def setUp(self):
self._budget_categories = database_population.create_budget_categories()
self._proposal = database_population.create_proposal()
def test_invalid_amount(self):
budget_item_data = dict_to_multivalue_dict(
{
'category': self._budget_categories[0].id,
'details': 'Trips',
'amount': 'Some Invalid Number'
}
)
budget_item_form = BudgetItemForm(data=budget_item_data)
self.assertFalse(budget_item_form.is_valid())
self.assertIn('amount', budget_item_form.errors)
def test_no_amount_with_details(self):
budget_item_data = dict_to_multivalue_dict(
{
'category': self._budget_categories[0].id,
'details': 'Trips'
}
)
budget_item_form = BudgetItemForm(data=budget_item_data)
self.assertFalse(budget_item_form.is_valid())
self.assertIn('amount', budget_item_form.errors)
def test_amount_is_zero_with_details(self):
budget_item_data = dict_to_multivalue_dict(
{
'category': self._budget_categories[0].id,
'details': 'Trips',
'amount': '0'
}
)
budget_item_form = BudgetItemForm(data=budget_item_data)
self.assertTrue(budget_item_form.is_valid())
def test_no_details_with_amount(self):
budget_item_data = dict_to_multivalue_dict(
{
'category': self._budget_categories[0].id,
'amount': '100'
}
)
budget_item_form = BudgetItemForm(data=budget_item_data)
self.assertFalse(budget_item_form.is_valid())
self.assertIn('details', budget_item_form.errors)
def test_valid_budget(self):
budget_item_data = dict_to_multivalue_dict(
{
'category': self._budget_categories[0].id,
'details': 'Trips',
'amount': 100
}
)
budget_item_form = BudgetItemForm(data=budget_item_data)
self.assertTrue(budget_item_form.is_valid())
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,045 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/reporting/views.py | import datetime
import io
from decimal import Decimal
import xlsxwriter
from django.db.models import Count, F, Sum, Min, Max
from django.http import HttpResponse
from django.utils import timezone
from django.views import View
from django.views.generic import TemplateView
from project_core.models import Call, Project, Gender, CareerStage, Proposal, FundingInstrument
from grant_management.models import Invoice, Installment
from project_core.templatetags.thousands_separator import thousands_separator
from reporting.models import FundingInstrumentYearMissingData
NOT_IN_DB_HEADER = 'Not in DB'
NOT_IN_DB_TOOLTIP = 'Probably data imported before the Projects Application existed'
class CareerStagePerCallCalculator:
def __init__(self, career_stage_field: str, foreign_key, missing_data):
self._career_stage_field = career_stage_field
self._foreign_key = foreign_key
self._missing_data = missing_data
self._career_stages = None
def calculate_career_stage_stats(self, generic_queryset):
if self._career_stages is None:
self._career_stages = CareerStagePerYearCalculator._career_stages_sorted()
result = {}
for career_stage in self._career_stages:
result[career_stage.name] = generic_queryset.filter(**{self._career_stage_field: career_stage}).count()
result[NOT_IN_DB_HEADER] = generic_queryset.filter(**{f'{self._career_stage_field}__isnull': True}).count()
return result
def calculate_result(self):
data = []
for call in Call.objects.filter(submission_deadline__lte=timezone.now()). \
order_by('long_name'):
is_missing_data, missing_data_reason = FundingInstrumentYearMissingData.is_missing_data(
self._missing_data,
funding_instrument=call.funding_instrument,
year=call.finance_year)
generic_queryset = getattr(call, self._foreign_key)
stats = self.calculate_career_stage_stats(generic_queryset)
for stat_key in stats.keys():
if is_missing_data:
stats[stat_key] = missing_data_reason
stats['Grant Scheme'] = call.long_name_without_finance_year()
stats['Year'] = call.finance_year
data.append(stats)
result = {}
result['headers'] = ['Grant Scheme', 'Year'] + CareerStagePerYearCalculator._header_names()
result['data'] = data
result['header_tooltips'] = {NOT_IN_DB_HEADER: NOT_IN_DB_TOOLTIP}
return result
class CareerStagePerYearCalculator:
def __init__(self, model, career_stage_field, missing_data_type):
self._model = model
self._career_stage_field = career_stage_field
self._missing_data_type = missing_data_type
if self._model == Proposal:
self._finance_year_filter_key = 'call__finance_year'
elif self._model == Project:
self._finance_year_filter_key = 'finance_year'
else:
assert False
def calculate_career_stage_stats(self, generic_queryset):
if self._career_stages is None:
self._career_stages = CareerStage.objects.all()
result = {}
for career_stage in self._career_stages:
result[career_stage.name] = generic_queryset.filter(**{self._career_stage_field: career_stage}).count()
result[NOT_IN_DB_HEADER] = generic_queryset.filter(**{f'{self._career_stage_field}__isnull': True}).count()
return result
@staticmethod
def _career_stages_sorted():
return CareerStage.objects.order_by('list_order')
@staticmethod
def _header_names():
result = []
for career_stage in CareerStagePerYearCalculator._career_stages_sorted():
result.append(career_stage.name)
result.append(NOT_IN_DB_HEADER)
return result
def _calculate_min_year(self) -> int:
# Using the minimum to have '-' if needed for old calls
# (see _calculate_max_year)
return min(
Call.objects.aggregate(Min('finance_year'))['finance_year__min'],
Project.objects.aggregate(Min('finance_year'))['finance_year__min']
)
def _calculate_max_year(self) -> int:
# Using the maximum because there might not be calls for a year but
# there might be funded projects (created not from a call)
return max(
Call.objects.aggregate(Max('finance_year'))['finance_year__max'],
Project.objects.aggregate(Max('finance_year'))['finance_year__max']
)
def calculate_result(self):
data = []
for funding_instrument in FundingInstrument.objects.all().order_by('long_name'):
min_year = self._calculate_min_year()
max_year = self._calculate_max_year()
# for year in Call.objects.all().values_list('finance_year', flat=True).distinct().order_by('finance_year'):
for year in range(self._calculate_min_year(), self._calculate_max_year() + 1):
row = {}
row['Year'] = year
is_missing_data, missing_data_reason = FundingInstrumentYearMissingData.is_missing_data(
self._missing_data_type, year=year)
for career_stage in CareerStagePerYearCalculator._career_stages_sorted():
row[career_stage.name] = value_or_missing_data(is_missing_data,
missing_data_reason,
self._model.objects.
filter(**{self._finance_year_filter_key: year}).
filter(**{self._career_stage_field: career_stage}).
count())
row[NOT_IN_DB_HEADER] = value_or_missing_data(is_missing_data,
missing_data_reason,
self._model.objects.
filter(**{self._finance_year_filter_key: year}).
filter(**{f'{self._career_stage_field}__isnull': True}).
count())
data.append(row)
result = {}
result['headers'] = ['Year'] + CareerStagePerYearCalculator._header_names()
result['data'] = data
result['header_tooltips'] = {NOT_IN_DB_HEADER: NOT_IN_DB_TOOLTIP}
return result
def not_none_or_function(item1, item2, function):
if item1 is None and item2 is not None:
return item2
elif item1 is not None and item2 is None:
return item1
elif item1 is None and item2 is None:
return None
else:
return function(item1, item2)
def calculate_min_year_for_funding_instrument(funding_instrument):
projects_min_year = Project.objects.filter(funding_instrument=funding_instrument).aggregate(Min('finance_year'))[
'finance_year__min']
proposals_min_year = \
Proposal.objects.filter(call__funding_instrument=funding_instrument).filter(
call__callevaluation__isnull=False).aggregate(Min('call__finance_year'))[
'call__finance_year__min']
return not_none_or_function(projects_min_year, proposals_min_year, min)
def calculate_max_year_for_funding_instrument(funding_instrument):
projects_max_year = Project.objects.filter(funding_instrument=funding_instrument).aggregate(Max('finance_year'))[
'finance_year__max']
proposals_max_year = \
Proposal.objects.filter(call__funding_instrument=funding_instrument).filter(
call__callevaluation__isnull=False).aggregate(Max('call__finance_year'))[
'call__finance_year__max']
return not_none_or_function(projects_max_year, proposals_max_year, max)
class GenderCalculator:
def __init__(self, main_model, missing_data_type):
self._main_model = main_model
self._missing_data_type = missing_data_type
self._grant_scheme_text = 'Grant Scheme'
self._year_text = 'Year'
self._gender_list = list(Gender.objects.all().order_by('name'))
self._gender_name_list = []
if self._main_model == Proposal:
self._gender_field = 'applicant__person__gender'
elif self._main_model == Project:
self._gender_field = 'principal_investigator__person__gender'
else:
assert False
for gender in self._gender_list:
self._gender_name_list.append(gender.name)
def _calculate_genders(self, generic_queryset):
result = {}
for gender in self._gender_list:
result[gender.name] = generic_queryset.filter(**{self._gender_field: gender.id}).count()
result[NOT_IN_DB_HEADER] = generic_queryset.filter(**{f'{self._gender_field}__isnull': True}).count()
return result
def _calculate_min_year_for_funding_instrument(self, funding_instrument):
return Project.objects.filter(funding_instrument=funding_instrument).aggregate(Min('finance_year'))[
'finance_year__min']
def _calculate_max_year_for_funding_instrument(self, funding_instrument):
return Project.objects.filter(funding_instrument=funding_instrument).aggregate(Max('finance_year'))[
'finance_year__max']
def calculate_result(self):
data = []
for funding_instrument in FundingInstrument.objects.all().order_by('long_name'):
min_year = calculate_min_year_for_funding_instrument(funding_instrument)
max_year = calculate_max_year_for_funding_instrument(funding_instrument)
if min_year is None or max_year is None:
continue
for finance_year in range(min_year, max_year + 1):
if self._main_model == Proposal:
generic_queryset = Proposal.objects. \
filter(call__finance_year=finance_year). \
filter(call__funding_instrument=funding_instrument). \
order_by('call__long_name')
elif self._main_model == Project:
generic_queryset = Project.objects.filter(finance_year=finance_year). \
filter(funding_instrument=funding_instrument). \
order_by('funding_instrument__long_name')
else:
assert False
percentages = self._calculate_genders(generic_queryset)
missing_data, missing_data_reason = FundingInstrumentYearMissingData.is_missing_data(
self._missing_data_type, funding_instrument=funding_instrument, year=finance_year)
if missing_data:
for key in percentages.keys():
percentages[key] = missing_data_reason
percentages[self._grant_scheme_text] = funding_instrument.long_name
percentages[self._year_text] = finance_year
data.append(percentages)
result = {}
result['headers'] = [self._grant_scheme_text, self._year_text] + self._gender_name_list + [NOT_IN_DB_HEADER]
result['data'] = data
result['header_tooltips'] = {NOT_IN_DB_HEADER: NOT_IN_DB_TOOLTIP}
return result
class ObjectsPerFundingInstrumentPerYear:
def __init__(self, model, missing_data):
self._model = model
self._missing_data = missing_data
self._funding_instruments = list(FundingInstrument.objects.all().order_by('long_name'))
self._funding_instruments_long_names = []
for funding_instrument in self._funding_instruments:
self._funding_instruments_long_names.append(funding_instrument.long_name)
self._start_year = Project.objects.aggregate(Min('finance_year'))['finance_year__min']
self._end_year = Project.objects.aggregate(Max('finance_year'))['finance_year__max']
def _get_headers(self):
return ['Year'] + self._funding_instruments_long_names
def _count_objects(self, funding_instrument, year):
if self._model == Proposal:
calls = Call.objects.filter(funding_instrument=funding_instrument).filter(finance_year=year)
if calls.exists():
return self._model.objects.filter(call__in=calls).count()
else:
return '-'
elif self._model == Project:
return self._model.objects.filter(funding_instrument=funding_instrument).filter(finance_year=year).count()
else:
assert False
def calculate_result(self):
data = []
for year in range(self._start_year, self._end_year + 1):
row = {}
row['Year'] = year
for funding_instrument in self._funding_instruments:
is_missing_data, missing_data_reason = FundingInstrumentYearMissingData.is_missing_data(
self._missing_data,
funding_instrument=funding_instrument,
year=year)
if is_missing_data:
row[funding_instrument.long_name] = missing_data_reason
continue
row[funding_instrument.long_name] = self._count_objects(funding_instrument, year)
data.append(row)
result = {}
result['headers'] = self._get_headers()
result['data'] = data
return result
def value_or_missing_data(is_missing_data, missing_data_reason, value):
if is_missing_data:
return missing_data_reason
return value
def calculate_number_of_calls():
result = {}
calls_per_year = Call.objects.filter(submission_deadline__lte=timezone.now()). \
values(Year=F('finance_year')). \
annotate(Calls=Count('*')). \
order_by('finance_year')
result['data'] = calls_per_year
result['headers'] = ['Year', 'Calls']
return result
def calculate_paid_so_far_year(year):
total = 0
for project in Project.objects.filter(finance_year=year):
total += project.invoices_paid_amount()
return total
def calculate_open_for_payment(year):
total = 0
for project in Project.objects.filter(finance_year=year):
if project.is_active():
total += project.allocated_budget - project.invoices_paid_amount() - project.underspending_amount()
else:
# If the project is closed
pass
return total
def calculate_unpaid_invoice(year):
total = 0
for project in Project.objects.filter(finance_year=year):
if project.is_active():
total += project.invoices_paid_amount()
for installment in Installment.objects.filter(project=project):
for invoice in Invoice.objects.filter(installment=installment):
total -= invoice.amount
else:
# If the project is closed
pass
return total
def allocated_budget_per_year():
result = {}
financial_support_per_year = Project.objects. \
values(year=F('finance_year')). \
annotate(commitment=Sum('allocated_budget')). \
order_by('finance_year')
data = []
for row in financial_support_per_year:
year = row['year']
commitment = row['commitment']
data.append({'Year': year,
'Commitment (CHF)': thousands_separator(commitment),
'Paid to date (CHF)': thousands_separator(calculate_paid_so_far_year(year)),
'Outstanding commitment (CHF)': thousands_separator(calculate_open_for_payment(year)),
'Unpaid Invoices (CHF)': thousands_separator(calculate_unpaid_invoice(year)),
})
result['data'] = data
result['headers'] = ['Year', 'Commitment (CHF)', 'Paid to date (CHF)', 'Outstanding commitment (CHF)',
'Unpaid Invoices (CHF)']
result['right_align_columns'] = [2, 3, 4, 5]
# result['header_tooltips'] = {'Outstanding commitment (CHF)': ''}
return result
def calculate_paid_so_far_funding_instrument_year(funding_instrument_long_name, year):
total = 0
for project in Project.objects.filter(funding_instrument__long_name=funding_instrument_long_name). \
filter(finance_year=year):
total += project.invoices_paid_amount()
return total
def calculate_open_for_payment_funding_instrument_year(funding_instrument_long_name, year):
total = 0
for project in Project.objects.filter(funding_instrument__long_name=funding_instrument_long_name). \
filter(finance_year=year):
if project.is_active():
total += project.allocated_budget - project.invoices_paid_amount() - project.underspending_amount()
else:
# If the project is closed
pass
return total
def calculate_unpaid_invoice_funding_instrument_year(funding_instrument_long_name, year):
total = 0
for project in Project.objects.filter(funding_instrument__long_name=funding_instrument_long_name). \
filter(finance_year=year):
if project.is_active():
total += project.invoices_paid_amount()
for installment in Installment.objects.filter(project=project):
for invoice in Invoice.objects.filter(installment=installment):
total -= invoice.amount
else:
# If the project is closed
pass
return total
def allocated_budget_per_call():
result = {}
allocated_budget_per_call = Project.objects. \
values(call_name=F('funding_instrument__long_name'),
account_number=F('funding_instrument__short_name__account_number'),
finance_year_=F('finance_year')). \
annotate(financial_support=Sum('allocated_budget')). \
order_by('finance_year')
data = []
for row in allocated_budget_per_call:
funding_instrument_long_name = row['call_name']
year = row['finance_year_']
paid_so_far = calculate_paid_so_far_funding_instrument_year(funding_instrument_long_name, year)
open_for_payment = calculate_open_for_payment_funding_instrument_year(funding_instrument_long_name, year)
unpaid_invoice = calculate_unpaid_invoice_funding_instrument_year(funding_instrument_long_name, year)
data.append({'Grant Scheme': row['call_name'],
'Account Number': row['account_number'],
'Year': row['finance_year_'],
'Commitment (CHF)': thousands_separator(row['financial_support']),
'Paid to date (CHF)': thousands_separator(paid_so_far),
'Outstanding commitment (CHF)': thousands_separator(open_for_payment),
'Unpaid Invoices (CHF)': thousands_separator(unpaid_invoice),
})
result['headers'] = ['Grant Scheme', 'Account Number', 'Year', 'Commitment (CHF)', 'Paid to date (CHF)',
'Outstanding commitment (CHF)', 'Unpaid Invoices (CHF)']
result['data'] = data
result['right_align_columns'] = [4, 5, 6, 7]
return result
def gender_proposal_applicants_per_call():
gender_percentage_calculator = GenderCalculator(Proposal,
FundingInstrumentYearMissingData.MissingDataType.GENDER_PROPOSAL_APPLICANT)
return gender_percentage_calculator.calculate_result()
def gender_project_principal_investigator_per_call():
gender_percentage_calculator = GenderCalculator(Project,
FundingInstrumentYearMissingData.MissingDataType.GENDER_FUNDED_PROJECT_PI)
return gender_percentage_calculator.calculate_result()
def career_stage_proposal_applicants_per_year():
career_stage_calculator = CareerStagePerYearCalculator(Proposal, 'applicant__career_stage',
FundingInstrumentYearMissingData.MissingDataType.CAREER_STAGE_PROPOSAL_APPLICANT)
return career_stage_calculator.calculate_result()
def career_stage_projects_principal_investigators_per_year():
career_stage_calculator = CareerStagePerYearCalculator(Project, 'principal_investigator__career_stage',
FundingInstrumentYearMissingData.MissingDataType.CAREER_STAGE_FUNDED_PROJECT_PI)
return career_stage_calculator.calculate_result()
def career_stage_proposal_applicants_per_call():
career_stage_calculator = CareerStagePerCallCalculator('applicant__career_stage', 'proposal_set',
FundingInstrumentYearMissingData.MissingDataType.CAREER_STAGE_PROPOSAL_APPLICANT)
return career_stage_calculator.calculate_result()
def career_stage_project_principal_investigator_per_call():
career_stage_calculator = CareerStagePerCallCalculator('principal_investigator__career_stage', 'project_set',
FundingInstrumentYearMissingData.MissingDataType.CAREER_STAGE_FUNDED_PROJECT_PI)
return career_stage_calculator.calculate_result()
def proposals_per_funding_instrument():
proposals_calculator = ObjectsPerFundingInstrumentPerYear(Proposal,
FundingInstrumentYearMissingData.MissingDataType.PROPOSALS)
return proposals_calculator.calculate_result()
def projects_per_funding_instrument():
projects_calculator = ObjectsPerFundingInstrumentPerYear(Project, None)
return projects_calculator.calculate_result()
class Reporting(TemplateView):
template_name = 'reporting/reporting.tmpl'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['calls_per_year'] = calculate_number_of_calls()
context['allocated_budget_per_year'] = allocated_budget_per_year()
context['allocated_budget_per_call'] = allocated_budget_per_call()
context['proposals_genders'] = gender_proposal_applicants_per_call()
context['projects_genders'] = gender_project_principal_investigator_per_call()
context['career_stage_proposal_applicants_per_year'] = career_stage_proposal_applicants_per_year()
context[
'career_stage_projects_principal_investigators_per_year'] = career_stage_projects_principal_investigators_per_year()
context['career_stage_proposal_applicants_per_call'] = career_stage_proposal_applicants_per_call()
context[
'career_stage_project_principal_investigator_per_call'] = career_stage_project_principal_investigator_per_call()
context['proposals_per_funding_instrument'] = proposals_per_funding_instrument()
context['projects_per_funding_instrument'] = projects_per_funding_instrument()
context.update({'active_section': 'reporting',
'active_subsection': 'reporting',
'sidebar_template': 'reporting/_sidebar-reporting.tmpl',
'breadcrumb': [{'name': 'Reporting'}]})
context['active_tab'] = self.request.GET.get('tab', 'overview')
return context
def format_number_for_swiss_locale(number):
return str(number).replace('.', ',')
def format_date_for_swiss_locale(date):
return date.strftime('%d/%m/%Y')
class ProjectsAllInformationExcel(View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def _headers():
return ['Key', 'Grant scheme', 'Name of PI', 'Organisation', 'Gender', 'Career stage', 'Geographic focus',
'Location', 'Keywords', 'Title', 'Signed date', 'Start date', 'End date', 'Allocated budget',
'Underspending', 'Unpaid Invoices', 'Total paid', 'Balance due', 'Status', 'Call Year', 'Lay summary']
@staticmethod
def _rows():
rows = []
for project in Project.objects.all().order_by('key'):
financial_information = ProjectsBalanceExcel.financial_information(project)
if project.principal_investigator.person.gender:
gender = project.principal_investigator.person.gender.name
else:
gender = 'N/A'
if project.principal_investigator.career_stage:
career_stage = project.principal_investigator.career_stage.name
else:
career_stage = 'N/A'
geographical_areas = ', '.join([str(area) for area in project.geographical_areas.order_by('name')])
extra_information = {
'Grant scheme': project.funding_instrument.long_name,
'Name of PI': project.principal_investigator.person.full_name(),
'Gender': gender,
'Career stage': career_stage,
'Geographic focus': geographical_areas,
'Location': project.location or '-',
'Keywords': project.keywords_enumeration(),
'Status': project.status,
'Call Year': project.finance_year,
'Lay summary': project.main_lay_summary_web(),
}
rows.append({**financial_information, **extra_information})
return rows
@staticmethod
def _col_widths():
return {**ProjectsBalanceExcel.col_widths(),
**{
'Grant scheme': 30,
'Name of PI': 20,
'Career stage': 35,
'Geographic focus': 25,
'Location': 50,
'Keywords': 50,
'Status': 10,
}}
def get(self, request, *args, **kwargs):
now = timezone.localtime()
filename = f'projects-information-{now:%Y%m%d-%H%M}.xlsx'
response = HttpResponse(content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
response['Content-Disposition'] = f'attachment; filename="{filename}"'
response.content = excel_dict_writer(filename,
ProjectsAllInformationExcel._headers(),
ProjectsAllInformationExcel._rows(),
ProjectsAllInformationExcel._col_widths())
return response
class ProjectsBalanceExcel(View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def headers():
return ['Key', 'Signed date', 'Organisation', 'Title', 'Start date', 'End date', 'Allocated budget',
'Underspending', 'Unpaid Invoices' ,'Total paid', 'Balance due', 'Status']
@staticmethod
def financial_information(project):
pi_organisations = project.principal_investigator.organisations_ordered_by_name_str()
if hasattr(project, 'grantagreement'):
if project.grantagreement.signed_date:
grant_agreement_signed_date = project.grantagreement.signed_date
else:
grant_agreement_signed_date = 'Grant agreement not signed'
else:
grant_agreement_signed_date = 'No grant agreement attached'
balance_due = project.allocated_budget - project.invoices_paid_amount() - project.underspending_amount()
return {'Key': project.key,
'Signed date': grant_agreement_signed_date,
'Organisation': pi_organisations,
'Title': project.title,
'Start date': project.start_date if project.start_date else 'N/A',
'End date': project.end_date if project.end_date else 'N/A',
'Allocated budget': project.allocated_budget,
'Underspending': project.underspending_amount(),
'Unpaid Invoices': project.to_be_paid_amount(),
'Total paid': project.invoices_paid_amount(),
'Balance due': balance_due,
'Status': project.status,
}
@staticmethod
def rows():
rows = []
for project in Project.objects.all().order_by('key'):
rows.append(ProjectsBalanceExcel.financial_information(project))
return rows
@staticmethod
def col_widths():
return {
'Key': 15,
'Organisation': 40,
'Title': 80,
'Signed date': 12,
'Start date': 12,
'End date': 12,
'Allocated budget': 12,
'Underspending': 12,
'Unpaid Invoices': 12,
'Total paid': 12,
'Balance due': 12,
'Status': 10,
}
def get(self, request, *args, **kwargs):
now = timezone.localtime()
filename = f'projects-balance-{now:%Y%m%d-%H%M}.xlsx'
response = HttpResponse(content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
response['Content-Disposition'] = f'attachment; filename="{filename}"'
response.content = excel_dict_writer(filename,
ProjectsBalanceExcel.headers(),
ProjectsBalanceExcel.rows(),
ProjectsBalanceExcel.col_widths())
return response
def excel_dict_writer(filename, headers, rows, col_widths):
output = io.BytesIO()
workbook = xlsxwriter.Workbook(output)
worksheet = workbook.add_worksheet()
worksheet.write_row(0, 0, headers)
date_format = workbook.add_format({'num_format': 'dd-mm-yyyy'})
decimal_format = workbook.add_format({'num_format': "#,##0.00"})
for row_index, row in enumerate(rows, 1):
to_use_headers = headers.copy()
for header_name, cell_value in row.items():
column_index = headers.index(header_name)
to_use_headers.remove(header_name)
if isinstance(cell_value, datetime.date):
worksheet.write_datetime(row_index, column_index, cell_value, date_format)
elif isinstance(cell_value, Decimal):
worksheet.write_number(row_index, column_index, cell_value, decimal_format)
else:
worksheet.write(row_index, column_index, cell_value)
assert to_use_headers == []
for col_width_name, col_width in col_widths.items():
column_index = headers.index(col_width_name)
worksheet.set_column(column_index, column_index, col_width)
workbook.close()
output.seek(0)
return output
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,046 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0116_makes_funding_instrument_short_name_not_nullable.py | # Generated by Django 3.0.3 on 2020-04-02 08:22
from django.db import migrations, models
def make_abbreviation(long_name):
short_name = ''
for word in long_name.split(' '):
short_name += word[0].upper()
return short_name
def create_funding_instrument_short_name(apps, schema_editor):
FundingInstrument = apps.get_model('project_core', 'FundingInstrument')
for funding_instrument in FundingInstrument.objects.all():
funding_instrument.short_name = make_abbreviation(funding_instrument.long_name)
funding_instrument.save()
class Migration(migrations.Migration):
dependencies = [
('project_core', '0115_historicalproject'),
]
operations = [
migrations.RunPython(create_funding_instrument_short_name),
migrations.AlterField(
model_name='fundinginstrument',
name='short_name',
field=models.CharField(help_text='Short name or acronym of the funding instrument', max_length=60, unique=True),
),
migrations.AlterField(
model_name='historicalfundinginstrument',
name='short_name',
field=models.CharField(db_index=True, help_text='Short name or acronym of the funding instrument', max_length=60),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,047 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0028_adds_installment.py | # Generated by Django 3.0.5 on 2020-05-08 08:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
('grant_management', '0027_bblog_post_text'),
]
operations = [
migrations.CreateModel(
name='Installment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('due_date', models.DateField(help_text='Due date of this instalment')),
('amount', models.DecimalField(decimal_places=2, help_text='Amount of this instalment', max_digits=11)),
('project', models.ForeignKey(help_text='Project that this installment refers to', on_delete=django.db.models.deletion.PROTECT, to='project_core.Project')),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='invoice',
name='installment',
field=models.ForeignKey(blank=True, help_text='Which installment this invoice refers to', null=True, on_delete=django.db.models.deletion.PROTECT, to='grant_management.Installment'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,048 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0041_createmodify_keywords.py | # Generated by Django 2.2.6 on 2019-10-21 14:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0040_createmodify_to_question_models'),
]
operations = [
migrations.RemoveField(
model_name='keyword',
name='date_created',
),
migrations.AddField(
model_name='keyword',
name='created_by',
field=models.ForeignKey(blank=True, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_keyword_created_by_related', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='keyword',
name='created_on',
field=models.DateTimeField(default=django.utils.timezone.now, help_text='Date and time at which the entry was created'),
),
migrations.AddField(
model_name='keyword',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_keyword_modified_by_related', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='keyword',
name='modified_on',
field=models.DateTimeField(blank=True, help_text='Date and time at which the entry was modified', null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,049 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0034_added_proposal_eligibility.py | # Generated by Django 2.2.6 on 2019-10-21 10:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0033_proposal_timeframe_chnages'),
]
operations = [
migrations.AddField(
model_name='proposal',
name='eligibility',
field=models.BooleanField(default=0, help_text='Eligibility status of proposal'),
preserve_default=False,
),
migrations.AddField(
model_name='proposal',
name='eligibility_comment',
field=models.TextField(blank=True, help_text='Comments regarding eligibility of proposal', null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,050 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0120_financial_key_name_unique.py | # Generated by Django 3.0.5 on 2020-05-20 14:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0119_financialkey'),
]
operations = [
migrations.AlterField(
model_name='financialkey',
name='name',
field=models.CharField(help_text='Code used by finance (e.g. ECON, TRAVEL) or funding instrument', max_length=20, unique=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,051 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0164_callcareerstage.py | # Generated by Django 3.2 on 2021-05-05 12:25
import django.db.models.deletion
from django.db import migrations, models
def add_all_career_stages_to_calls(apps, schema_editor):
Call = apps.get_model('project_core', 'Call')
CareerStage = apps.get_model('project_core', 'CareerStage')
CallCareerStage = apps.get_model('project_core', 'CallCareerStage')
career_stages = CareerStage.objects.all()
for call in Call.objects.all():
for career_stage in career_stages:
CallCareerStage.objects.create(call=call,
career_stage=career_stage)
class Migration(migrations.Migration):
dependencies = [
('project_core', '0163_add_account_number'),
]
operations = [
migrations.CreateModel(
name='CallCareerStage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('call', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='project_core.call')),
('career_stage',
models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='project_core.careerstage')),
],
),
migrations.RunPython(add_all_career_stages_to_calls)
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,052 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0008_auto_add_unique_indexes.py | # Generated by Django 2.2.4 on 2019-09-25 14:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0007_rename_person_organisation_to_organisations'),
]
operations = [
migrations.AlterField(
model_name='callquestion',
name='answer_type',
field=models.CharField(choices=[('Text', 'Text')], default='Text', help_text='Type of field that should be applied to the question answer', max_length=5),
),
migrations.AlterField(
model_name='keyword',
name='description',
field=models.CharField(help_text='Description of a keyword that should be used to distinguish it from another keyword', max_length=512),
),
migrations.AlterUniqueTogether(
name='proposalqatext',
unique_together={('proposal', 'call_question')},
),
migrations.AlterUniqueTogether(
name='proposedbudgetitem',
unique_together={('category', 'proposal')},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,053 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/migrations/0017_renames_closed_to_closed_date.py | # Generated by Django 3.0.3 on 2020-03-16 12:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0016_callevaluation_closed'),
]
operations = [
migrations.RenameField(
model_name='callevaluation',
old_name='closed',
new_name='closed_date',
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,054 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0076_physical_person_unique_not_including_gender.py | # Generated by Django 2.2.6 on 2019-11-06 18:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0075_budgetcategory_order'),
]
operations = [
migrations.AlterField(
model_name='fundinginstrument',
name='description',
field=models.TextField(help_text='Description of the funding instrument that can be used to distinguish it from others'),
),
migrations.AlterUniqueTogether(
name='physicalperson',
unique_together={('first_name', 'surname')},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,055 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/migrations/0011_adds_decision_letter.py | # Generated by Django 3.0.3 on 2020-03-05 09:05
from django.db import migrations, models
import evaluation.models
import storages.backends.s3boto3
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0010_file_name_processed_on_save'),
]
operations = [
migrations.AddField(
model_name='historicalproposalevaluation',
name='decision_letter',
field=models.TextField(blank=True, max_length=100, null=True),
),
migrations.AddField(
model_name='proposalevaluation',
name='decision_letter',
field=models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=evaluation.models.proposal_evaluation_eligibility_letter_rename),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,056 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0008_makes_financial_report_file_optional.py | # Generated by Django 3.0.3 on 2020-04-10 09:59
from django.db import migrations, models
import grant_management.models
import storages.backends.s3boto3
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0007_rename_financereport_to_financialreport'),
]
operations = [
migrations.AlterField(
model_name='financialreport',
name='file',
field=models.FileField(blank=True, null=True, storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=grant_management.models.finance_report_file_rename),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,057 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/forms/utils.py | from django.urls import reverse
from django.utils.safestring import mark_safe
from project_core.utils.utils import format_date
def error_due_date_too_early(project):
project_basic_information_edit = reverse('logged-grant_management-project-basic-information-update',
kwargs={'project': project.id})
return mark_safe(f'Due date should be after project start date ({format_date(project.start_date)}). '
f'If needed <a href="{project_basic_information_edit}">edit the project start date</a>')
def error_due_date_too_late(project):
project_basic_information_edit = reverse('logged-grant_management-project-basic-information-update',
kwargs={'project': project.id})
return mark_safe(
f'Due date should be before the project end date ({format_date(project.end_date)}). '
f'If needed <a href="{project_basic_information_edit}">edit the project end date</a>')
def error_received_date_too_early(project):
project_basic_information_edit = reverse('logged-grant_management-project-basic-information-update',
kwargs={'project': project.id})
return mark_safe(f'Date received should be after project start date ({format_date(project.start_date)}). '
f'If needed <a href="{project_basic_information_edit}">edit the project start date</a>')
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,058 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/forms/applicant_role.py | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div
from django import forms
from project_core.forms.utils import LabelAndOrderNameChoiceField
from project_core.models import RoleDescription
from variable_templates.utils import apply_templates_to_fields
class RoleDescriptionForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
call = kwargs.pop('call', None)
super().__init__(*args, **kwargs)
apply_templates_to_fields(self.fields, call)
self.helper = FormHelper(self)
self.helper.form_tag = False
self.helper.layout = Layout(
Div(
Div('role', css_class='col-12'),
css_class='row'
),
Div(
Div('description', css_class='col-12'),
css_class='row'
),
Div(
Div('competences', css_class='col-12'),
css_class='row'
),
)
def clean(self):
return super().clean()
class Meta:
model = RoleDescription
fields = ['role', 'description', 'competences']
help_texts = {'role': 'Select the role of the applicant in the proposed {{ activity }}',
'description': "Description of the applicant's role",
'competences': "Description of the applicant's key competences"
}
field_classes = {'role': LabelAndOrderNameChoiceField}
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,059 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/reporting/migrations/0003_funding_instrument_description.py | # Generated by Django 3.0.10 on 2020-10-23 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reporting', '0002_add_reason_missing_data_field'),
]
operations = [
migrations.AlterField(
model_name='fundinginstrumentyearmissingdata',
name='description',
field=models.CharField(help_text='Reason that there is missing data. It might be shown in the management', max_length=128),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,060 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/call_question.py | from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse
from django.views.generic import TemplateView, UpdateView, FormView
from project_core.forms.call_question import CallQuestionForm, CallQuestionFromTemplateQuestionForm
from project_core.models import CallQuestion, CallPart
class CallPartQuestionView(TemplateView):
template_name = 'logged/call_part-question_answer-detail.tmpl'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
call_question = CallQuestion.objects.get(pk=self.kwargs['call_question_pk'])
call = call_question.call_part.call
context['call_question'] = call_question
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'
})
url_call_parts_anchor = reverse('logged-call-detail', kwargs={'pk': call.pk}) + '#parts'
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-call-list')},
{'name': f'Details ({call.short_name})',
'url': url_call_parts_anchor},
{'name': 'List Call Parts',
'url': reverse('logged-call-part-list', kwargs={'call_pk': call.pk})},
{'name': f'Call Part ({call_question.call_part.title_rendered()})',
'url': reverse('logged-call-part-detail',
kwargs={'call_pk': call.pk,
'call_part_pk': call_question.call_part.pk})},
{'name': f'Question: {call_question.question_text}'}
]
return context
class CallPartQuestionUpdate(SuccessMessageMixin, UpdateView):
model = CallQuestion
template_name = 'logged/call_part-question_answer-form.tmpl'
form_class = CallQuestionForm
pk_url_kwarg = 'call_question_pk'
context_object_name = 'call_question'
success_message = 'Call question updated'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
call_question = context['call_question']
context['call'] = call_question.call_part.call
context['callpart'] = call_question.call_part
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'
})
call = call_question.call_part.call
url_call_parts_anchor = reverse('logged-call-detail', kwargs={'pk': call.pk}) + '#parts'
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-call-list')},
{'name': f'Details ({call.short_name})',
'url': url_call_parts_anchor},
{'name': 'List Call Parts',
'url': reverse('logged-call-part-list', kwargs={'call_pk': call.pk})},
{'name': f'Call Part ({call_question.call_part.title_rendered()})',
'url': reverse('logged-call-part-detail',
kwargs={'call_pk': call.pk,
'call_part_pk': call_question.call_part.pk})},
{'name': f'Question: {call_question.question_text}'}
]
return context
def get_success_url(self):
return reverse('logged-call-part-question-detail', kwargs={'call_pk': self.object.call_part.call.pk,
'call_question_pk': self.object.pk
})
class CallPartQuestionTemplateQuestionUpdate(SuccessMessageMixin, FormView):
template_name = 'logged/call_part-question_answer-form.tmpl'
form_class = CallQuestionFromTemplateQuestionForm
success_message = 'Question(s) added'
def get_context_data(self, **kwargs):
call_part: CallPart = CallPart.objects.get(pk=self.kwargs['call_part_pk'])
call = call_part.call
context = super().get_context_data(**kwargs)
context['call'] = call
context['callpart'] = call_part
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-calls')},
{'name': f'Details ({call.little_name()})',
'url': reverse('logged-call-detail', kwargs={'pk': call.pk})},
{'name': f'Call Part ({call_part.title_rendered()})',
'url': reverse('logged-call-part-detail', kwargs={'call_pk': call.pk,
'call_part_pk': call_part.pk
}
)
},
{'name': 'View Call Question'}]
return context
def form_valid(self, form):
is_valid_form = super().form_valid(form)
if is_valid_form:
form.save()
return is_valid_form
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
kwargs['call_part_pk'] = self.kwargs['call_part_pk']
return kwargs
def get_success_url(self):
call_pk = self.kwargs['call_pk']
return reverse('logged-call-update', kwargs={'pk': call_pk}) + '#parts'
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,061 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0031_improves_medium.py | # Generated by Django 3.0.5 on 2020-05-12 10:44
from django.db import migrations, models
import django.db.models.deletion
import grant_management.models
import storages.backends.s3boto3
class Migration(migrations.Migration):
dependencies = [
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
('grant_management', '0030_renames_media_to_medium'),
]
operations = [
migrations.RemoveField(
model_name='medium',
name='created_on',
),
migrations.RemoveField(
model_name='medium',
name='due_date',
),
migrations.RemoveField(
model_name='medium',
name='modified_on',
),
migrations.RemoveField(
model_name='medium',
name='received_date',
),
migrations.AddField(
model_name='medium',
name='file',
field=models.FileField(default=None, storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=grant_management.models.medium_file_rename),
preserve_default=False,
),
migrations.AlterField(
model_name='medium',
name='author',
field=models.ForeignKey(help_text='Person who took the photo', on_delete=django.db.models.deletion.PROTECT, to='project_core.PhysicalPerson'),
),
migrations.AlterField(
model_name='medium',
name='license',
field=models.ForeignKey(help_text='License', on_delete=django.db.models.deletion.PROTECT, to='grant_management.License'),
),
migrations.AlterField(
model_name='medium',
name='project',
field=models.ForeignKey(help_text='Project that this medium belongs to', on_delete=django.db.models.deletion.PROTECT, to='project_core.Project'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,062 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/models.py | import calendar
import logging
import os
import uuid as uuid_lib
from datetime import datetime
from typing import List
import unidecode as unidecode
from botocore.exceptions import EndpointConnectionError, ClientError
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.models import User, Group
from django.core.validators import MinValueValidator, RegexValidator, validate_slug, MaxValueValidator
from django.core.validators import validate_email
from django.db import models, transaction
from django.db.models import Sum
from django.urls import reverse
from django.utils import timezone
from phonenumber_field.phonenumber import PhoneNumber
from simple_history.models import HistoricalRecords
from storages.backends.s3boto3 import S3Boto3Storage
from . import utils
from .utils.SpiS3Boto3Storage import SpiS3Boto3Storage
from .utils.orcid import raise_error_if_orcid_invalid
from .utils.utils import bytes_to_human_readable, external_file_validator, calculate_md5_from_file_field, \
management_file_validator, user_is_in_group_name
logger = logging.getLogger('project_core')
def add_one_if(start, condition):
if condition:
return start + 1
else:
return start
finance_year_validator = [MinValueValidator(2015, 'Finance year cannot be before SPI existed'),
MaxValueValidator(datetime.today().year + 2,
'Finance year cannot be more than two years after the current year')]
class CreateModifyOn(models.Model):
"""Details of data creation and modification: including date, time and user."""
created_on = models.DateTimeField(help_text='Date and time at which the entry was created', auto_now_add=True)
modified_on = models.DateTimeField(help_text='Date and time at which the entry was modified', auto_now=True,
blank=True, null=True)
class Meta:
abstract = True
class FinancialKey(CreateModifyOn):
name = models.CharField(max_length=20, help_text='Code used by finance (e.g. ECON, TRAVEL) or funding instrument',
unique=True)
account_number = models.IntegerField(help_text='Code use by the accounting department', unique=True,
null=True, blank=False)
description = models.CharField(max_length=200, help_text='Explanation of the code')
created_by = models.ForeignKey(User, on_delete=models.PROTECT)
funding_instrument = models.BooleanField(default=True,
help_text='This financial key is booked or used for a funding instrument')
def __str__(self):
return self.name
class BudgetCategory(models.Model):
"""Details of budget categories"""
name = models.CharField(help_text='Name of the budget category', max_length=100, unique=True)
description = models.CharField(help_text='Description of the budget category', max_length=300)
order = models.PositiveIntegerField(help_text='Use the integer order to order the categories', default=10)
class Meta:
verbose_name_plural = 'Budget categories'
def __str__(self):
return self.name
@staticmethod
def all_ordered():
return BudgetCategory.objects.all().order_by('order', 'name')
class FundingInstrument(CreateModifyOn):
"""Details of a funding instrument. This is the highest level of something to which a call can be attributed.
For example, an exploratory Grant is the funding instrument, and the annual round of applications would come as part
of a call."""
long_name = models.CharField(help_text='Full name of funding instrument', max_length=200, unique=True)
short_name = models.OneToOneField(FinancialKey, help_text='Short name or acronym of the funding instrument',
null=True, on_delete=models.PROTECT)
description = models.TextField(
help_text='Description of the funding instrument that can be used to distinguish it from others')
history = HistoricalRecords()
def __str__(self):
return '{}'.format(self.long_name)
def get_absolute_url(self):
return reverse('logged-funding-instrument-detail', args=[str(self.pk)])
class Call(CreateModifyOn):
"""Description of call."""
long_name = models.CharField(help_text='Full name of the call', max_length=200, unique=True)
short_name = models.CharField(help_text='Short name or acronym of the call', max_length=60, blank=True, null=True)
finance_year = models.IntegerField(
help_text='Finance year of this call. It is used, for example, for the project key from this call',
validators=finance_year_validator)
description = models.TextField(help_text='Description of the call that can be used to distinguish it from others')
funding_instrument = models.ForeignKey(FundingInstrument, help_text='Funding instrument to which the call belongs',
on_delete=models.PROTECT)
introductory_message = models.TextField(help_text='Introductory text to the call for applicants', blank=True,
null=True)
call_open_date = models.DateTimeField(help_text='Date on which the call is opened')
submission_deadline = models.DateTimeField(help_text='Submission deadline of the call')
budget_maximum = models.DecimalField(help_text='Maximum amount that can be requested in the proposal budget',
decimal_places=2, max_digits=10, validators=[MinValueValidator(0)])
# TODO: this questions should be moved to another model instead of Booleans here
other_funding_question = models.BooleanField(help_text='True if the Other Funding question is enabled')
proposal_partner_question = models.BooleanField(help_text='True if the Proposal Partner question is enabled')
overarching_project_question = models.BooleanField(
help_text='True if the question for the overarching project is displayed',
default=False)
scientific_clusters_question = models.BooleanField(help_text='True if the Research Cluster question is enabled',
default=False)
keywords_in_general_information_question = models.BooleanField(
help_text='True if we want to ask the keywords in the general section',
default=True)
overall_budget_question = models.BooleanField(
help_text='True to add the question "Requested overall budget". Useful to request a bulk number instead of '
'the budget breakdown. Budget breakdown is displayed/hidden depending on the categories checked in'
' its section',
default=False)
history = HistoricalRecords()
def __str__(self):
return self.long_name
def little_name(self):
if self.short_name:
return self.short_name
else:
return f'{self.long_name[:10]}...'
def long_name_without_finance_year(self):
return self.long_name.replace(str(self.finance_year), '').strip()
@staticmethod
def open_calls():
return Call.objects.filter(call_open_date__lte=timezone.now(),
submission_deadline__gte=timezone.now())
@staticmethod
def closed_calls():
return Call.objects.filter(submission_deadline__lte=timezone.now())
@staticmethod
def future_calls():
return Call.objects.filter(call_open_date__gte=timezone.now())
def number_of_proposals(self):
return self.proposal_set.count()
def number_of_proposals_no_draft(self):
draft = ProposalStatus.objects.get(name=settings.PROPOSAL_STATUS_DRAFT)
return self.proposal_set.exclude(proposal_status=draft).count()
# def callquestion_set_ordered_by_order(self):
# return self.callquestion_set.all().order_by('order')
@staticmethod
def attachment_object():
from comments.models import CallAttachment
return CallAttachment
def attachments(self):
return self.callattachment_set.all().order_by('created_on')
def comments(self):
return self.callcomment_set.all().order_by('created_on')
@staticmethod
def comment_object():
from comments.models import CallComment
return CallComment
def evaluation_is_closed(self):
result = hasattr(self, 'callevaluation') and self.callevaluation.is_closed()
return result
def parts(self) -> List['CallPart']:
parts = []
heading_number = self.get_part_numbers_for_call()['roles_competences']
for part in self.callpart_set.order_by('order'):
part.heading_number = heading_number = heading_number + 1
parts.append(part)
return parts
def budget_requested_part(self):
return self.budgetcategorycall_set.filter(enabled=True).exists()
def get_part_numbers_for_call(self):
"""
Returns a dictionary with the heading numbers for different sections.
Sections that are not used currently have a heading number TODO: set them to None and use it to display
or not instead of having a second variable
"""
numbers = {}
numbers['general_information'] = 1
numbers['scientific_clusters'] = add_one_if(numbers['general_information'], self.scientific_clusters_question)
numbers['roles_competences'] = add_one_if(numbers['scientific_clusters'], self.proposal_partner_question)
numbers['budget_requested'] = numbers['roles_competences'] + self.callpart_set.count() + 1
numbers['other_sources_of_funding'] = add_one_if(numbers['budget_requested'], self.budget_requested_part())
return numbers
def enabled_career_stages_queryset(self):
career_stages = CallCareerStage.objects.filter(call=self).filter(enabled=True).values_list('career_stage__id',
flat=True)
return CareerStage.objects.filter(id__in=career_stages).order_by('list_order')
def reviewers(self):
return self.reviewer_set.all().order_by('person__first_name', 'person__surname')
class BudgetCategoryCall(CreateModifyOn):
call = models.ForeignKey(Call,
help_text='Call where this category is used in',
on_delete=models.PROTECT)
budget_category = models.ForeignKey(BudgetCategory,
help_text='Budget category for this category',
on_delete=models.PROTECT)
enabled = models.BooleanField(help_text='Appears in the proposal form', default=False)
order = models.PositiveIntegerField(blank=True, null=True)
class Meta:
unique_together = (('call', 'budget_category'),)
def __str__(self):
return self.budget_category.name
class StepType(models.Model):
"""Notable steps during the process"""
name = models.CharField(help_text='Name of a step', max_length=60, unique=True)
description = models.CharField(help_text='Description of a step', max_length=200)
def __str__(self):
return '{}'.format(self.name)
class Step(CreateModifyOn):
"""Dates of notable steps that are used throughout the process"""
call = models.ForeignKey(Call, help_text='Step within a call', on_delete=models.PROTECT)
step_type = models.ForeignKey(StepType, help_text='Name of step', max_length=128,
on_delete=models.PROTECT)
date = models.DateTimeField(help_text='Date and time of notable date', max_length=64, null=False)
class Meta:
unique_together = (('call', 'step_type'),)
def __str__(self):
return '{} - {}'.format(self.step_type, self.date)
class AbstractQuestion(CreateModifyOn):
"""Questions and details relating to their answers that can be used throughout the process"""
TEXT = 'Text'
FILE = 'File'
TYPES = (
(TEXT, 'Text'),
(FILE, 'File')
)
question_text = models.TextField(help_text='Question text')
question_description = models.TextField(
help_text='Explanation of question to enable full completion of answer',
null=True, blank=True)
answer_type = models.CharField(help_text='Type of field that should be applied to the question answer',
max_length=5, choices=TYPES, default=TEXT)
answer_max_length = models.PositiveIntegerField(
help_text='Maximum number of words for a question answer', blank=True, null=True,
verbose_name='Answer maximum length (used for answer type TEXT, in words)')
answer_required = models.BooleanField(default=True)
history = HistoricalRecords(inherit=True)
class Meta:
abstract = True
def extra_information(self):
required_text = 'required' if self.answer_required else 'not required'
if self.answer_type == AbstractQuestion.FILE:
return f'FILE, {required_text}'
elif self.answer_type == AbstractQuestion.TEXT:
if self.answer_max_length is None:
return f'TEXT, no max words, {required_text}'
else:
return f'TEXT, max {self.answer_max_length} words, {required_text}'
else:
assert False
def __str__(self):
return f'{self.question_text} ({self.extra_information()})'
class TemplateQuestion(AbstractQuestion):
"""Questions used as templates that can be added to calls or other aspects of the forms."""
def get_absolute_url(self):
return reverse('logged-template-question-detail', args=[str(self.pk)])
class CallQuestion(AbstractQuestion):
"""Questions, taken from the template list, that are part of a call. """
template_question = models.ForeignKey(TemplateQuestion,
help_text='Template question on which this call question is based',
on_delete=models.PROTECT)
order = models.PositiveIntegerField(
help_text='Use this number to order the questions')
call_part = models.ForeignKey('CallPart', help_text='To which Call Part this question belongs to',
on_delete=models.PROTECT)
class Meta:
unique_together = (('call_part', 'template_question'), ('call_part', 'order'),)
# @transaction.atomic
# def save(self, *args, **kwargs):
# if self.order is None:
# call_questions = CallQuestion.objects.filter(call=self.call_part)
# if call_questions:
# self.order = call_questions.aggregate(Max('order'))['order__max'] + 1
# else:
# self.order = 1
#
# super().save(*args, **kwargs)
#
@staticmethod
def from_template(template_question):
call_question = CallQuestion()
call_question.question_text = template_question.question_text
call_question.question_description = template_question.question_description
call_question.answer_type = template_question.answer_type
call_question.answer_max_length = template_question.answer_max_length
call_question.answer_required = template_question.answer_required
call_question.template_question = template_question
return call_question
class Source(CreateModifyOn):
"""Source from where a UID or other item originates."""
source = models.CharField(help_text='Source from which a UID or item may originate', max_length=200)
description = models.TextField(help_text='Description of the source eg. URL, version', null=True, blank=True)
def __str__(self):
return '{}'.format(self.source)
class Uid(CreateModifyOn):
"""Uid used to distinguish unique items in vocabulary lists"""
uid = models.CharField(help_text='Unique identifier', max_length=150, null=True)
source = models.ForeignKey(Source, help_text='Source of the UID', on_delete=models.PROTECT)
class Meta:
abstract = True
unique_together = (('uid', 'source'),)
def __str__(self):
return '{}: {} {}'.format(self.source, self.uid, self.created_on)
class KeywordUid(Uid):
"""Uid used to identify a keyword"""
pass
def __str__(self):
return '{}-{}'.format(self.uid, self.source)
class Keyword(CreateModifyOn):
"""Set of keywords used to describe the topic of a project, proposal, mission etc. """
name = models.CharField(help_text='Name of a keyword', max_length=128)
description = models.CharField(
help_text='Description of a keyword that should be used to distinguish it from another keyword', max_length=512,
blank=True, null=True)
uid = models.ForeignKey(KeywordUid, help_text='Source from which the keyword originated', on_delete=models.PROTECT)
class Meta:
unique_together = (('name', 'description'),)
def __str__(self):
return '{}'.format(self.name)
class ProposalStatus(models.Model):
"""Status options for a proposal"""
name = models.CharField(help_text='Name of the status of the proposal table', max_length=50, unique=True)
description = models.CharField(help_text='Detailed description of the proposal status name', max_length=512)
class Meta:
verbose_name_plural = 'Proposal status'
def __str__(self):
return '{} - {}'.format(self.name, self.description)
class PersonTitle(models.Model):
"""Personal and academic titles"""
title = models.CharField(help_text='Personal or academic title used by a person', max_length=50, unique=True)
def __str__(self):
return self.title
class CountryUid(Uid):
"""Uid used to identify a country"""
pass
def __str__(self):
return '{}-{}'.format(self.uid, self.source)
class Country(CreateModifyOn):
"""Countries"""
name = models.CharField(help_text='Country name', max_length=100, unique=True)
uid = models.ForeignKey(CountryUid, help_text='UID of country name', on_delete=models.PROTECT, blank=True,
null=True)
class Meta:
verbose_name_plural = 'Countries'
def __str__(self):
return self.name
class OrganisationUid(Uid):
"""Uid used to identify an organisation."""
pass
def __str__(self):
return '{}-{}'.format(self.uid, self.source)
class Organisation(CreateModifyOn):
"""Details of an organisation - could be scientific, institution, funding etc."""
long_name = models.CharField(help_text='Full name by which the organisation is known', max_length=100)
short_name = models.CharField(help_text='Short name by which the organisation is commonly known', max_length=50,
blank=True, null=True)
display_name = models.CharField(help_text='Name of organisation used for display purposes', max_length=100,
blank=True, null=True)
street = models.CharField(help_text='Street address of the organisation', max_length=500, blank=True, null=True)
city = models.CharField(help_text='City in which the organisation is based', max_length=100)
postal_code = models.CharField(help_text='Postal code of the organisation', max_length=50, blank=True, null=True)
country = models.ForeignKey(Country, help_text='Country in which the organisation is based',
on_delete=models.PROTECT)
uid = models.ForeignKey(OrganisationUid, help_text='UID of an organisation', on_delete=models.PROTECT)
class Meta:
unique_together = (('long_name', 'country'),)
def __str__(self):
return '{} - {}'.format(self.long_name, self.country)
def abbreviated_name(self):
if self.short_name is not None:
return self.short_name
else:
return (self.long_name[:47] + '...') if len(self.long_name) > 50 else self.long_name
class OrganisationName(CreateModifyOn):
"""This is used by the dropdown box to the users. Users can add organisation names and will not be associated
with the organisation until SPI creates the organisation and links it. It's an easy way to allow users to enter
organisations without details and without having what seems to not exist: a full list of organisations. """
name = models.CharField(help_text='A name that the organisation is known for', max_length=100, unique=True)
organisation = models.ForeignKey(Organisation, blank=True, null=True, on_delete=models.PROTECT)
def public_name(self):
if self.organisation:
if self.organisation.english_name:
return self.organisation.english_name
else:
return self.organisation.long_name
else:
return self.name
def __str__(self):
return '{}'.format(self.name)
class Gender(CreateModifyOn):
"""Gender with which a person identifies."""
name = models.CharField(help_text='Name of gender', max_length=20, unique=True)
def __str__(self):
return '{}'.format(self.name)
class PhysicalPerson(CreateModifyOn):
"""Information about a unique person."""
first_name = models.CharField(help_text='First name(s) of a person', max_length=100)
surname = models.CharField(help_text='Last name(s) of a person', max_length=100)
orcid = models.CharField(help_text='Orcid ID', max_length=19, null=True, unique=True,
validators=utils.orcid.orcid_validators())
gender = models.ForeignKey(Gender, help_text='Gender with which the person identifies', blank=True, null=True,
on_delete=models.PROTECT)
phd_date = models.CharField(help_text='Date (yyyy-mm) on which PhD awarded or expected', max_length=20, blank=True,
null=True, validators=[RegexValidator(regex='^[0-9]{4}-[0-9]{2}$',
message='Format is yyyy-mm',
code='Invalid format')])
historical = HistoricalRecords()
class Meta:
verbose_name_plural = 'Physical People'
def __str__(self):
return '{} {}'.format(self.first_name, self.surname)
def full_name(self):
return '{} {}'.format(self.first_name, self.surname)
def phd_date_formatted(self):
if self.phd_date is None:
return None
year, month = self.phd_date.split('-')
month = int(month)
if month < 1 or month > 12:
return f'{month}-{year}'
return f'{calendar.month_abbr[int(month)]}. {year}'
class PersonUid(Uid):
"""UID used for a person"""
person = models.OneToOneField(PhysicalPerson, help_text='Person to which the UID refers', on_delete=models.PROTECT)
def __str__(self):
return '{} {}: {}'.format(self.person, self.source, self.uid)
class CareerStage(models.Model):
"""Stage of a person within their career."""
name = models.CharField(help_text='Name of career stage', max_length=50, unique=True)
description = models.CharField(help_text='Description of the career stage', max_length=100)
list_order = models.IntegerField(help_text='Order that this field is displayed', null=True, blank=True)
def __str__(self):
return '{}'.format(self.name)
class PersonPosition(CreateModifyOn):
"""Information about a person that may change as they move through their career."""
person = models.ForeignKey(PhysicalPerson, help_text='A unique physical person', on_delete=models.PROTECT)
academic_title = models.ForeignKey(PersonTitle, help_text='Title of the person', on_delete=models.PROTECT)
career_stage = models.ForeignKey(CareerStage, help_text='Stage of the person in the career',
on_delete=models.PROTECT, blank=True, null=True)
organisation_names = models.ManyToManyField(OrganisationName, help_text='Organisation(s) represented by the person')
group = models.CharField(help_text='Name of the working group, department, laboratory for which the person works',
max_length=200, blank=True, null=True)
privacy_policy = models.BooleanField(
help_text='Agree or disagree to the data policy for storage of personal information', default=False)
contact_newsletter = models.BooleanField(help_text='Agree or disagree to being contacted by email with newsletter',
default=False)
historical = HistoricalRecords()
def __str__(self):
organisations_list = []
for organisation_name in self.organisation_names.all().order_by('name'):
organisations_list.append(organisation_name.name)
organisations_str = ', '.join(organisations_list)
return '{} {} - {}'.format(self.academic_title, self.person, organisations_str)
def main_email(self):
email = self.main_email_model()
if email:
return email.entry
else:
return None
def main_phone(self):
phone = self.main_phone_model()
if phone:
return phone.entry
else:
return None
def main_phone_uri(self):
phone = self.main_phone()
if phone:
return PhoneNumber.from_string(phone).as_rfc3966
return None
def main_email_model(self):
emails = self.contact_set.filter(method=Contact.EMAIL).order_by('created_on')
if emails:
return emails[0]
else:
return None
def main_phone_model(self):
phones = self.contact_set.filter(method=Contact.PHONE).order_by('created_on')
if phones:
return phones[0]
else:
return None
def organisations_ordered_by_name(self):
return self.organisation_names.all().order_by('name')
def organisations_display_names(self):
organisations = []
for organisation in self.organisation_names.all():
if organisation.organisation is None:
organisations.append(organisation.name)
elif organisation.organisation.display_name:
organisations.append(organisation.organisation.display_name)
else:
organisations.append(organisation.organisation.long_name)
organisations.sort()
return ', '.join(organisations)
def organisations_ordered_by_name_str(self):
organisations = []
for organisation in self.organisations_ordered_by_name():
if organisation.organisation is None:
organisations.append(organisation.name)
else:
organisations.append(organisation.organisation.long_name)
return ', '.join(organisations)
class Contact(CreateModifyOn):
"""Contact details of a person"""
OFFICE = 'Office'
MOBILE = 'Mobile'
EMAIL = 'Email'
PHONE = 'Phone'
METHOD = (
(OFFICE, 'Office'),
(MOBILE, 'Mobile'),
(EMAIL, 'Email'),
(PHONE, 'Phone')
)
person_position = models.ForeignKey(PersonPosition, help_text='Person to whom the contact details belong',
on_delete=models.PROTECT)
entry = models.CharField(help_text='Text of contact entry, such as phone number, pager etc.', max_length=100)
method = models.CharField(help_text='Type of contact method', max_length=30, choices=METHOD)
history = HistoricalRecords()
class Meta:
unique_together = (('person_position', 'entry', 'method'),)
def __str__(self):
return '{} - {}: {}'.format(self.person_position, self.method, self.entry)
def clean(self):
if self.method == Contact.EMAIL:
validate_email(self.entry)
super().clean()
class GeographicalAreaUid(Uid):
"""UID of a geographical area."""
pass
def __str__(self):
return '{}-{}'.format(self.uid, self.source)
class GeographicalArea(CreateModifyOn):
"""Geographical area (exact coverage of this not yet determined)"""
name = models.CharField(help_text='Name of geographic area', max_length=100, unique=True)
definition = models.CharField(
help_text='Detailed description of the geographic area to avoid duplicate entries or confusion', max_length=300)
uid = models.ForeignKey(GeographicalAreaUid, help_text='UID of a geographical area', on_delete=models.PROTECT,
blank=True, null=True)
def __str__(self):
return '{}'.format(self.name)
class ExternalProject(CreateModifyOn):
title = models.CharField(help_text='Title of the project', max_length=500)
leader = models.ForeignKey(PersonPosition, help_text='Leader of this project',
blank=True, null=True, on_delete=models.PROTECT)
def __str__(self):
return f'{self.title} - {self.leader}'
class PostalAddress(CreateModifyOn):
# We've decided to not normalise this model
address = models.TextField(help_text='Department name, street/avenue, block, building, floor, door, etc.')
city = models.CharField(max_length=256)
postcode = models.CharField(max_length=128)
country = models.ForeignKey(Country, on_delete=models.PROTECT)
def __str__(self):
return f'{self.address} - {self.city} - {self.postcode} - {self.country}'
class Role(models.Model):
"""Role a person can take in a variety of different circumstances."""
PROPOSAL = 'Proposal'
PROJECT = 'Project'
EXPEDITION = 'Expedition'
TYPES = (
(PROPOSAL, 'Proposal'),
(PROJECT, 'Project'),
(EXPEDITION, 'Expedition'),
)
name = models.CharField(help_text='Name of role', max_length=50)
description = models.CharField(help_text='Description of role to distinguish it from others', max_length=200)
type = models.CharField(
help_text='Part of the application to which the role refers, determining where it can be used in some cases',
choices=TYPES, max_length=25)
class Meta:
unique_together = (('name', 'type'),)
def __str__(self):
return '{} ({}): {}'.format(self.name, self.type, self.description)
class RoleDescription(CreateModifyOn):
# It holds the description of a Role for a Partner, Applicant, etc. (a person with a role)
role = models.ForeignKey(Role, help_text='Role of the partner', on_delete=models.PROTECT)
description = models.TextField(help_text="Description of the role")
competences = models.TextField(help_text="Description of the key competences")
class Proposal(CreateModifyOn):
"""Proposal submitted for a call - not yet evaluated and therefore not yet a project."""
ELIGIBILITYNOTCHECKED = 'Eligibility not checked'
ELIGIBLE = 'Eligible'
NOTELIGIBLE = 'Not eligible'
STATUS = (
(ELIGIBILITYNOTCHECKED, 'Eligibility not checked'),
(ELIGIBLE, 'Eligible'),
(NOTELIGIBLE, 'Not eligible'),
)
uuid = models.UUIDField(db_index=True, default=uuid_lib.uuid4, editable=False, unique=True)
title = models.CharField(help_text='Title of the proposal being submitted', max_length=500)
postal_address = models.ForeignKey(PostalAddress,
help_text='Address to where the grant agreement is going to be sent',
null=True,
on_delete=models.PROTECT)
keywords = models.ManyToManyField(Keyword, help_text='Keywords that describe the proposal', blank=True)
geographical_areas = models.ManyToManyField(GeographicalArea,
help_text='Geographical area(s) covered by the proposal')
location = models.CharField(
help_text='Name of more precise location of where proposal would take place (not coordinates)',
max_length=200, blank=True, null=True) # Consider having this as another text question
start_date = models.DateField(
help_text='Approximate date on which the proposed project is expected to start')
end_date = models.DateField(
help_text='Approximate date on which the proposed project is expected to end')
duration_months = models.DecimalField(
help_text='Expected duration of the proposed project in months',
decimal_places=2, max_digits=5, validators=[MinValueValidator(0)])
applicant = models.ForeignKey(PersonPosition, help_text='Main applicant of the proposal',
on_delete=models.PROTECT)
applicant_role_description = models.ForeignKey(RoleDescription, help_text='Main applicant role', blank=True,
null=True,
on_delete=models.PROTECT)
proposal_status = models.ForeignKey(ProposalStatus, help_text='Status or outcome of the proposal',
on_delete=models.PROTECT)
eligibility = models.CharField(help_text='Status of eligibility of proposal', max_length=30,
default=ELIGIBILITYNOTCHECKED, choices=STATUS)
eligibility_comment = models.TextField(help_text='Comments regarding eligibility of proposal', blank=True,
null=True)
call = models.ForeignKey(Call, help_text='Call to which the proposal relates', on_delete=models.PROTECT)
overarching_project = models.ForeignKey(ExternalProject, null=True, blank=True, on_delete=models.PROTECT)
draft_saved_mail_sent = models.BooleanField(default=False,
help_text='True if the email informing the applicant that the draft has been saved has already been sent (usually is sent only once)')
submitted_mail_sent = models.BooleanField(default=False,
help_text='True if the email informing the applicant that the proposal has been submitted has been sent')
overall_budget = models.DecimalField(decimal_places=2, max_digits=10,
validators=[MinValueValidator(0)],
null=True, blank=True,
help_text='If Call.overall_budget_question is enabled it contains the overall budget. It should be used only if no Budget Categories')
history = HistoricalRecords()
class Meta:
unique_together = (('title', 'applicant', 'call'),)
def __str__(self):
return '{} - {}'.format(self.title, self.applicant)
def get_absolute_url(self):
return reverse('proposal-update', kwargs={'uuid': self.uuid})
def keywords_enumeration(self):
keywords = self.keywords.all().order_by('name')
if keywords:
return ', '.join([keyword.name for keyword in keywords])
else:
return '-'
def geographical_areas_enumeration(self):
geographical_areas = self.geographical_areas.all().order_by('name')
if geographical_areas:
return ', '.join([geographical_area.name for geographical_area in geographical_areas])
else:
return '-'
def total_budget(self):
"""
If the call has overall_budget_question: returns the overall_budget.
Else returns the sum of the budget items.
Get the total budget requested by a proposal by summing the items of a budget for a proposal.
:return: returns total amount of budget
"""
if self.call.overall_budget_question:
return self.overall_budget
# TODO: do this in the database
budget_items = self.proposedbudgetitem_set.all()
total = 0
for item in budget_items:
if item.amount is not None:
total += item.amount
return total
def status_is_draft(self):
return self.proposal_status.name == settings.PROPOSAL_STATUS_DRAFT
def status_is_submitted(self):
return self.proposal_status.name == settings.PROPOSAL_STATUS_SUBMITTED
def eligibility_is_eligible(self):
return self.eligibility == Proposal.ELIGIBLE
def attachments(self):
return self.proposalattachment_set.all().order_by('created_on')
def comments(self):
return self.proposalcomment_set.all().order_by('created_on')
@staticmethod
def attachment_object():
from comments.models import ProposalAttachment
return ProposalAttachment
@staticmethod
def comment_object():
from comments.models import ProposalComment
return ProposalComment
def can_eligibility_be_created_or_changed(self):
# TODO: if there is a project for this proposal it cannot be changed anymore
return not self.status_is_draft()
def reason_eligibility_cannot_be_created_or_changed(self):
if self.status_is_draft():
return 'Proposal status cannot be draft in order to create/edit eligibility'
# TODO: if can_eligibility_be_created_or_changed returned False because a project exists for this
# proposal: explain it here
assert False
def can_call_evaluation_be_visualised(self):
return hasattr(self.call, 'callevaluation')
def can_create_evaluation(self):
return self.status_is_submitted() and self.eligibility_is_eligible() and \
hasattr(self.call, 'callevaluation') and self.call.callevaluation.is_open()
def reason_cannot_create_evaluation(self):
if not self.status_is_submitted():
return 'To evaluate the proposal the status needs to be submitted'
elif not self.eligibility_is_eligible():
return 'To evaluate the proposal eligibility needs to be eligible'
elif not hasattr(self.call, 'callevaluation'):
return 'To evaluate the proposal a Call Evaluation needs to be created'
elif not self.call.callevaluation.is_open():
return 'To evaluate the proposal the Call Evaluation needs to be open'
assert False
def can_eligibility_be_edited(self):
return self.can_eligibility_be_created_or_changed() and not hasattr(self, 'proposalevaluation')
def reason_cannot_eligibility_be_edited(self):
if not self.can_eligibility_be_created_or_changed():
return self.reason_eligibility_cannot_be_created_or_changed()
elif self.proposalevaluation:
return 'Eligibility cannot be changed because a proposal evaluation already exists'
def scientific_clusters_ordered(self):
# Returns the scientific clusters ordered by 'id' as an easy way to order them by creation (hopefully)
# or at least consistent ordering
return self.proposalscientificcluster_set.order_by('id')
def file_name(self):
applicant_full_name = self.applicant.person.full_name()
filename = f'{self.call.short_name}-{applicant_full_name}'
filename = cleanup_file_name(filename)
return filename
def reviewers(self):
return self.reviewer_set.all().order_by('person__first_name', 'person__surname')
def cleanup_file_name(filename):
filename = filename.replace(' ', '_')
filename = filename.replace('.', '_')
filename = filename.replace('/', '')
filename = filename.replace('\\', '')
filename = unidecode.unidecode(filename)
return filename
class ProposalQAText(CreateModifyOn):
"""Questions assigned to a proposal and their respective answers"""
proposal = models.ForeignKey(Proposal, help_text='Questions and answers for a proposal', on_delete=models.PROTECT)
call_question = models.ForeignKey(CallQuestion, help_text='Question from the call', on_delete=models.PROTECT)
answer = models.TextField(help_text='Answer to the question from the call')
class Meta:
verbose_name_plural = 'Proposal question-answer (text)'
unique_together = (('proposal', 'call_question'),)
def __str__(self):
return 'Q: {}; A: {}'.format(self.call_question, self.answer)
class ProposalQAFile(CreateModifyOn):
proposal = models.ForeignKey(Proposal, help_text='Proposal that this file is attached to', on_delete=models.PROTECT)
call_question = models.ForeignKey(CallQuestion, help_text='Question from the call', on_delete=models.PROTECT)
file = models.FileField(storage=S3Boto3Storage(),
upload_to='proposals_qa/',
validators=[*external_file_validator()])
# Using md5 so it matches (usually) ETags
md5 = models.CharField(db_index=True, max_length=32)
def __str__(self):
return 'Q: {}; A: file'.format(self.call_question)
def save(self, *args, **kwargs):
if self.file:
self.md5 = calculate_md5_from_file_field(self.file)
else:
# Actually if there is no file this should not be called
self.md5 = None
super().save(*args, **kwargs)
def human_file_size(self):
try:
return bytes_to_human_readable(self.file.size)
except EndpointConnectionError:
logger.warning(f'NOTIFY: ProposalQAFile {self.id} EndpointConnectionError')
return 'Unknown -EndpointConnectionError'
except ClientError:
logger.warning(f'NOTIFY: ProposalQAFile {self.id} ClientError')
return 'Unknown -ClientError'
def file_name(self):
from variable_templates.utils import apply_templates_to_string
_, extension = os.path.splitext(self.file.name)
filename = f'{self.call_question.call_part.title}-{self.call_question.question_text[0:50]}'
filename = apply_templates_to_string(filename, self.call_question.call_part.call)
filename = cleanup_file_name(filename)
filename += f'{extension}'
return filename
class BudgetItem(models.Model):
"""Itemised line in a budget, comprising of a category, full details and the amount"""
category = models.ForeignKey(BudgetCategory, help_text='Name of the budget item',
on_delete=models.PROTECT)
details = models.TextField(help_text='Details of the budget item', blank=True)
amount = models.DecimalField(help_text='Cost of category item', decimal_places=2, max_digits=10,
validators=[MinValueValidator(0)], null=True)
class Meta:
abstract = True
def __str__(self):
return '{}: {}'.format(self.category, self.amount)
class ProposedBudgetItem(BudgetItem):
"""Itemised line in a budget as part of a proposal"""
proposal = models.ForeignKey(Proposal, help_text='Proposal it which the budget item relates',
on_delete=models.PROTECT)
class Meta:
unique_together = (('category', 'proposal',),)
class FundingStatus(models.Model):
"""Status of funding"""
status = models.CharField(help_text='Name of the status', max_length=30, unique=True)
description = models.CharField(help_text='Description of the status', max_length=100)
class Meta:
verbose_name_plural = 'Funding status'
def __str__(self):
return self.status
class FundingItem(models.Model):
"""Specific item of funding"""
organisation_name = models.ForeignKey(OrganisationName,
help_text='Name of organisation from which the funding is sourced',
on_delete=models.PROTECT)
funding_status = models.ForeignKey(FundingStatus, help_text='Status of the funding',
on_delete=models.PROTECT)
amount = models.DecimalField(help_text='Amount given in funding', decimal_places=2, max_digits=10,
validators=[MinValueValidator(0)])
class Meta:
abstract = True
def __str__(self):
return '{} - {}: {}'.format(self.organisation_name, self.funding_status, self.amount)
class ProposalFundingItem(FundingItem):
"""Specific item of funding for a proposal (referring to funding that has been sourced from elsewhere, rather than
funding that would result from that proposal being accepted)"""
proposal = models.ForeignKey(Proposal, help_text='Proposal for which the funding has been sourced',
on_delete=models.PROTECT)
class Meta:
unique_together = (('organisation_name', 'funding_status', 'proposal', 'amount'),)
class Partner(models.Model):
"""Person who is a partner"""
person = models.ForeignKey(PersonPosition, help_text='Person that is a partner', on_delete=models.PROTECT)
role = models.ForeignKey(Role, help_text='Role of the partner', on_delete=models.PROTECT)
role_description = models.TextField(help_text="Description of the partner's role")
competences = models.TextField(help_text="Description of the partner's key competences")
class Meta:
abstract = True
def __str__(self):
return '{} - {}'.format(self.person, self.role)
class ProposalPartner(Partner):
"""Partner that is part of a proposal."""
proposal = models.ForeignKey(Proposal, help_text='Proposal to on which the partner is collaborating',
on_delete=models.PROTECT)
class Meta:
unique_together = (('person', 'role', 'proposal'),)
class Project(CreateModifyOn):
"""Proposal that has been funded is now a project. Otherwise another project that has been accepted."""
search_fields = ('project__title', 'project__key', 'project__call__short_name', 'project__call__long_name',
'project__principal_investigator__person__first_name',
'project__principal_investigator__person__surname',
'project__principal_investigator__person__orcid',)
ONGOING = 'Ongoing'
COMPLETED = 'Completed'
ABORTED = 'Aborted'
STATUS = (
(ONGOING, 'Ongoing'),
(COMPLETED, 'Completed'),
(ABORTED, 'Aborted'),
)
uuid = models.UUIDField(db_index=True, default=uuid_lib.uuid4, editable=False, unique=True)
key = models.CharField(help_text='Project key identifier all the way to finance', max_length=64, unique=True)
title = models.CharField(help_text='Title of the project', max_length=500, )
funding_instrument = models.ForeignKey(FundingInstrument,
help_text='Funding instrument to which the project belongs',
on_delete=models.PROTECT)
finance_year = models.IntegerField(help_text='Finance year of this project', validators=finance_year_validator)
keywords = models.ManyToManyField(Keyword, help_text='Keywords that describe the project')
geographical_areas = models.ManyToManyField(GeographicalArea,
help_text='Geographical area(s) covered by the project')
location = models.CharField(
help_text='Name of more precise location of where the project would take place (not coordinates)',
max_length=200, blank=True, null=True)
start_date = models.DateField(
help_text='Date on which the project is expected to start')
end_date = models.DateField(
help_text='Date on which the project is expected to end')
principal_investigator = models.ForeignKey(PersonPosition, help_text='Main applicant of the project',
on_delete=models.PROTECT) # maybe rename this to principal investigator
call = models.ForeignKey(Call, help_text='Call to which the project belongs',
on_delete=models.PROTECT, null=True, blank=True)
proposal = models.ForeignKey(Proposal, help_text='Proposal from which the project originates', blank=True,
null=True, on_delete=models.PROTECT)
overarching_project = models.ForeignKey(ExternalProject,
help_text='Overarching project to which this project contributes',
blank=True, null=True, on_delete=models.PROTECT)
allocated_budget = models.DecimalField(help_text='Budget allocated to project', decimal_places=2, max_digits=10,
validators=[MinValueValidator(0)])
status = models.CharField(help_text='Status of a project', max_length=30, default=ONGOING, choices=STATUS)
abortion_reason = models.CharField(help_text='Reason that a project was aborted', max_length=50, blank=True,
null=True)
closed_on = models.DateTimeField(help_text='When the project was closed', blank=True, null=True)
closed_by = models.ForeignKey(User, on_delete=models.PROTECT, blank=True, null=True)
supervisor = models.ForeignKey(PersonPosition, help_text='Supervisor', blank=True, null=True,
on_delete=models.PROTECT, related_name='supervisor')
history = HistoricalRecords()
on_website = models.BooleanField(help_text='Appears in the website', default=False)
class Meta:
unique_together = (('title', 'principal_investigator', 'call'),)
def __str__(self):
return '{} - {}'.format(self.title, self.principal_investigator)
def key_pi(self):
return f'{self.key} {self.principal_investigator.person.surname}'
def keywords_enumeration(self):
keywords = self.keywords.all().order_by('name')
if keywords:
return ', '.join([keyword.name for keyword in keywords])
else:
return '-'
def geographical_areas_enumeration(self):
geographical_areas = self.geographical_areas.all().order_by('name')
if geographical_areas:
return ', '.join([geographical_area.name for geographical_area in geographical_areas])
else:
return '-'
@staticmethod
def comment_object():
from comments.models import ProjectComment
return ProjectComment
@staticmethod
def attachment_object():
from comments.models import ProjectAttachment
return ProjectAttachment
@staticmethod
def create_from_proposal(proposal, sequence):
project = Project()
project.title = proposal.title
project.funding_instrument = proposal.call.funding_instrument
project.finance_year = proposal.call.finance_year
project.key = f'{proposal.call.funding_instrument.short_name}-{proposal.call.finance_year}-{sequence:03d}'
project.location = proposal.location
project.start_date = proposal.start_date
project.end_date = proposal.end_date
project.principal_investigator = proposal.applicant
project.overarching_project = proposal.overarching_project
project.allocated_budget = proposal.proposalevaluation.allocated_budget
project.status = Project.ONGOING
project.call = proposal.call
project.proposal = proposal
project.save()
project.geographical_areas.add(*proposal.geographical_areas.all())
project.keywords.add(*proposal.keywords.all())
return project
def attachments(self):
return self.projectattachment_set.all().order_by('created_on')
def comments(self):
return self.projectcomment_set.all().order_by('created_on')
def main_lay_summary_web(self):
from grant_management.models import LaySummaryType
lay_summary_type_web = LaySummaryType.objects.get(name='Web')
lay_summaries = self.laysummary_set.filter(lay_summary_type=lay_summary_type_web).order_by('-created_on')
if lay_summaries:
return lay_summaries[0].text
else:
return None
def invoices_sent_for_payment_amount(self):
return self.invoice_set.filter(sent_for_payment_date__isnull=False).aggregate(Sum('amount'))['amount__sum'] or 0
def invoices_paid_amount(self):
return self.invoice_set.filter(paid_date__isnull=False).aggregate(Sum('amount'))['amount__sum'] or 0
def to_be_paid_amount(self):
return self.invoice_set.filter(paid_date__isnull=True).aggregate(Sum('amount'))['amount__sum'] or 0
def underspending_amount(self):
return self.underspending_set.aggregate(Sum('amount'))['amount__sum'] or 0
def number_of_comments_in_invoices(self):
total = 0
for invoice in self.invoice_set.all():
total += len(invoice.comments())
return total
def is_active(self):
return self.status == Project.ONGOING
def locations_coordinates_sorted(self):
return self.project_location.order_by('name')
class ProjectPartner(Partner):
"""Partner that is part of a project."""
project = models.ForeignKey(Project, help_text='Project on which the partner is collaborating',
on_delete=models.PROTECT)
class Meta:
unique_together = (('person', 'role', 'project'),)
class AbstractScientificCluster(CreateModifyOn):
title = models.CharField(max_length=500, help_text='Title of the research cluster')
keywords = models.ManyToManyField(Keyword, help_text='Keywords that describe the research cluster')
sub_pi = models.ForeignKey(PersonPosition, help_text='Main person of this research cluster',
on_delete=models.PROTECT)
def keywords_enumeration(self):
# TODO: refactor with other keywords_enumeration using a Mixin probably
keywords = self.keywords.all().order_by('name')
if keywords:
return ', '.join([keyword.name for keyword in keywords])
else:
return '-'
class Meta:
abstract = True
class ProposalScientificCluster(AbstractScientificCluster):
proposal = models.ForeignKey(Proposal,
help_text='Proposal that this Research Cluster refers to',
on_delete=models.PROTECT)
class Meta:
unique_together = (('title', 'proposal'),)
class CallPart(CreateModifyOn):
call = models.ForeignKey(Call,
help_text='Call that this ProposalPart belongs to',
on_delete=models.PROTECT)
title = models.CharField(max_length=500)
introductory_text = models.TextField(null=True, blank=True)
order = models.PositiveIntegerField(blank=True, null=True)
def questions_type_text(self):
return self.callquestion_set.filter(answer_type=CallQuestion.TEXT).order_by('order')
def questions_type_files(self):
return self.callquestion_set.filter(answer_type=CallQuestion.FILE).order_by('order')
def questions(self):
return self.callquestion_set.order_by('order')
def files(self):
return self.callpartfile_set.order_by('order')
def div_id(self):
return f'CallPart_{self.pk}'
def title_rendered(self):
from variable_templates.utils import apply_templates_to_string
return apply_templates_to_string(self.title, self.call)
class Meta:
unique_together = (('call', 'title'),)
def __str__(self):
return f'{self.call.short_name}-{self.title}'
def call_part_file_rename(instance: 'CallPartFile', filename):
base, extension = os.path.splitext(filename)
return f'project_core/CallPartFile/CallPartFile-{instance.pk}{extension}'
class CallPartFile(CreateModifyOn):
call_part = models.ForeignKey(CallPart,
help_text='Call part that this file belongs to',
on_delete=models.PROTECT)
name = models.CharField(max_length=64, help_text='Name of the file', validators=[validate_slug])
description = models.CharField(max_length=512, help_text='Description of this file', blank=True, null=True)
file = models.FileField(storage=SpiS3Boto3Storage(),
upload_to=call_part_file_rename,
validators=[*management_file_validator()])
order = models.PositiveIntegerField(blank=True, null=True)
def download_link(self):
return self.file.storage.download_link_with_name(self.file.name, filename=self.name)
def filename_with_extension(self):
basename, extension = os.path.splitext(self.file.name)
return f'{self.name}{extension}'
class Meta:
unique_together = (('call_part', 'name'),)
def __str__(self):
return f'{self.call_part}-{self.name}'
def get_absolute_url(self):
return reverse('logged-call-part-file-detail',
kwargs={'call_pk': self.call_part.call.pk, 'call_file_pk': self.pk})
class CallCareerStage(models.Model):
call = models.ForeignKey(Call, on_delete=models.PROTECT)
career_stage = models.ForeignKey(CareerStage, on_delete=models.PROTECT)
enabled = models.BooleanField(default=True)
def __str__(self):
return f'{self.call.short_name}-{self.career_stage.name}'
class SpiUser(User):
class Meta:
proxy = True
def is_management(self):
return user_is_in_group_name(self, settings.MANAGEMENT_GROUP_NAME)
def is_reviewer(self):
return user_is_in_group_name(self, settings.REVIEWER_GROUP_NAME)
def is_applicant(self):
return user_is_in_group_name(self, settings.APPLICANT_GROUP_NAME)
@staticmethod
@transaction.atomic
def set_type_of_user(user, type_of_user, physical_person=None):
# @staticmethod for how it's used regarding Forms and ProxyModels
assert type_of_user == settings.MANAGEMENT_GROUP_NAME or \
type_of_user == settings.REVIEWER_GROUP_NAME and physical_person or \
type_of_user == settings.APPLICANT_GROUP_NAME
reviewer_group = Group.objects.get(name=settings.REVIEWER_GROUP_NAME)
management_group = Group.objects.get(name=settings.MANAGEMENT_GROUP_NAME)
applicant_group = Group.objects.get(name=settings.APPLICANT_GROUP_NAME)
if type_of_user == settings.REVIEWER_GROUP_NAME:
user.groups.remove(management_group)
user.groups.remove(applicant_group)
user.groups.add(reviewer_group)
from evaluation.models import Reviewer
# Do not delete the reviewer to avoid losing the links
# to the existing Call Evaluation
#
# Here just re-raises and logs
r = Reviewer.objects.filter(user=user).first()
if r:
r.person = physical_person
r.save()
else:
Reviewer.objects.create(user=user, person=physical_person)
elif type_of_user == settings.MANAGEMENT_GROUP_NAME:
user.groups.remove(reviewer_group)
user.groups.remove(applicant_group)
user.groups.add(management_group)
elif type_of_user == settings.APPLICANT_GROUP_NAME:
user.groups.remove(reviewer_group)
user.groups.remove(management_group)
user.groups.add(applicant_group)
else:
assert False
user.save()
return True
def type_of_user(self):
count = 0
result = ''
if self.groups.filter(name=settings.REVIEWER_GROUP_NAME):
count += 1
result = settings.REVIEWER_GROUP_NAME
if self.groups.filter(name=settings.MANAGEMENT_GROUP_NAME):
count += 1
result = settings.MANAGEMENT_GROUP_NAME
if self.groups.filter(name=settings.APPLICANT_GROUP_NAME):
count += 1
result = settings.APPLICANT_GROUP_NAME
assert count < 2, 'Should belong only to reviewer or management or applicant groups'
return result
def type_of_user_str(self):
return self.type_of_user().capitalize()
def smart_first_name(self):
from evaluation.models import Reviewer
if self.type_of_user() == settings.REVIEWER_GROUP_NAME:
return Reviewer.objects.get(user=self).person.first_name
else:
return self.first_name
def smart_last_name(self):
from evaluation.models import Reviewer
if self.type_of_user() == settings.REVIEWER_GROUP_NAME:
return Reviewer.objects.get(user=self).person.surname
else:
return self.last_name
class Trace(CreateModifyOn):
name = models.CharField(max_length=64, help_text='Name of the trace', validators=[validate_slug])
class TraceCoordinates(models.Model):
lng = models.DecimalField(max_digits=14, decimal_places=3)
lat = models.DecimalField(max_digits=14, decimal_places=3)
trace = models.ForeignKey(Trace, help_text='Trace that the coordinate belongs to',
on_delete=models.PROTECT,
related_name='trace_coordinates')
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,063 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0100_funding_instrument_long_name_makes_unique.py | # Generated by Django 2.2.6 on 2020-01-20 11:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0099_proposal_mails_sent'),
]
operations = [
migrations.AlterField(
model_name='fundinginstrument',
name='long_name',
field=models.CharField(help_text='Full name of funding instrument', max_length=200, unique=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,064 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/models.py | import logging
import sys
from django.contrib.auth.models import User
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models, transaction
# Create your models here.
# add dates of review, signed date, who signed, grant agreement - need flexibilty in types of dates that are added
from django.db.models import Sum, Q
from django.utils.datetime_safe import datetime
from simple_history.models import HistoricalRecords
from storages.backends.s3boto3 import S3Boto3Storage
from django.core.files.uploadedfile import InMemoryUploadedFile
from PIL import Image, ExifTags, UnidentifiedImageError
from io import BytesIO
from project_core.models import CreateModifyOn, PhysicalPerson, Project, Organisation
from project_core.utils.utils import management_file_validator, calculate_md5_from_file_field
logger = logging.getLogger('grant_management')
def grant_agreement_file_rename(instance, filename):
return f'grant_management/GrantAgreement/Project-{instance.project.key}-{filename}'
class GrantAgreement(CreateModifyOn):
project = models.OneToOneField(Project, help_text='Project this Grant Agreement belongs to',
on_delete=models.PROTECT)
signed_date = models.DateField(help_text='Date the grant agreement was signed', null=True, blank=True)
signed_by = models.ManyToManyField(PhysicalPerson, help_text='People who signed the grant agreement', blank=True)
file = models.FileField(storage=S3Boto3Storage(), upload_to=grant_agreement_file_rename,
validators=[*management_file_validator()])
def __str__(self):
return f'{self.project}'
def signed_by_string(self):
return ', '.join(
[f'{person.first_name} {person.surname}' for person in self.signed_by.all().order_by('first_name')])
@staticmethod
def comment_object():
from comments.models import GrantAgreementComment
return GrantAgreementComment
@staticmethod
def attachment_object():
from comments.models import GrantAgreementAttachment
return GrantAgreementAttachment
def attachments(self):
return self.grantagreementattachment_set.all().order_by('created_on')
def comments(self):
return self.grantagreementcomment_set.all().order_by('created_on')
class AbstractProjectDueReceivedDate(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Abstract containing dates',
on_delete=models.PROTECT)
due_date = models.DateField(help_text='Date the document is due', null=True, blank=True)
received_date = models.DateField(help_text='Date the document was received', null=True, blank=True)
class Meta:
abstract = True
def __str__(self):
return f'{self.project}'
class Installment(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project that this installment refers to', on_delete=models.PROTECT)
amount = models.DecimalField(max_digits=11, decimal_places=2, help_text='Installment amount')
def __str__(self):
return f'{self.project}-{self.amount}'
def sent_for_payment(self):
return self.invoice_set.filter(sent_for_payment_date__isnull=False).aggregate(Sum('amount'))['amount__sum']
def paid(self):
return self.invoice_set.filter(paid_date__isnull=False).aggregate(Sum('amount'))['amount__sum']
def number(self):
# This is not very efficient, but given the number of invoices and installments it's nice to not have to
# save this in the database
installments = list(Installment.objects.filter(project=self.project).order_by('id'))
return installments.index(self) + 1
class Underspending(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project that this underspending refers to', on_delete=models.PROTECT)
amount = models.DecimalField(max_digits=11, decimal_places=2, help_text='Underspending amount')
def __str__(self):
return f'{self.amount}'
def number(self):
# This is not very efficient, but given the number of invoices and underspendings it's nice to not have to
# save this in the database
underspendings = list(Underspending.objects.filter(project=self.project).order_by('id'))
return underspendings.index(self) + 1
def invoice_file_rename(instance, filename):
return f'grant_management/Invoice/Project-{instance.project.key}-{filename}'
class Invoice(AbstractProjectDueReceivedDate):
sent_for_payment_date = models.DateField(help_text='Date the invoice was sent for payment', null=True, blank=True)
file = models.FileField(storage=S3Boto3Storage(), upload_to=invoice_file_rename, null=True,
validators=[*management_file_validator()],
blank=True)
paid_date = models.DateField(help_text='Date the invoice was paid', null=True, blank=True)
amount = models.DecimalField(max_digits=20, decimal_places=2, help_text='Total of the invoice (CHF)', null=True,
blank=True)
installment = models.ForeignKey(Installment, help_text='Installment to which the invoice is assigned', null=True,
blank=True, on_delete=models.PROTECT)
allow_overbudget = models.BooleanField(default=False, help_text='This invoice takes a payment overbudget')
overbudget_allowed_by = models.ForeignKey(User, null=True, blank=True, help_text='User that allowed the overbudget',
on_delete=models.PROTECT)
def __str__(self):
return f'Id: {self.id} Amount: {self.amount}'
@staticmethod
def comment_object():
from comments.models import InvoiceComment
return InvoiceComment
@staticmethod
def attachment_object():
return None
def installment_number(self):
# This is not very efficient, but given the number of invoices and installments it's nice to not have to
# save this in the database
if self.installment is None:
return None
return self.installment.number()
def due_date_passed(self):
return self.due_date and self.due_date < datetime.today().date() and self.paid_date is None
def negative(self):
return self.amount and self.amount < 0
def comments(self):
return self.invoicecomment_set.all().order_by('created_on')
def attachments(self):
return None
class AbstractProjectReport(AbstractProjectDueReceivedDate):
sent_for_approval_date = models.DateField(help_text='Date the report was sent for approval', null=True, blank=True)
approval_date = models.DateField(help_text='Date the report was approved',
blank=True, null=True)
approved_by = models.ForeignKey(PhysicalPerson, help_text='Person who approved the report',
on_delete=models.PROTECT, blank=True, null=True)
class Meta:
abstract = True
def due_date_passed(self):
return self.due_date and self.due_date < datetime.today().date() and self.approval_date is None
def finance_report_file_rename(instance, filename):
return f'grant_management/FinancialReport/Project-{instance.project.key}-{filename}'
class FinancialReport(AbstractProjectReport):
file = models.FileField(storage=S3Boto3Storage(), upload_to=finance_report_file_rename,
validators=[*management_file_validator()],
blank=True, null=True)
def scientific_report_file_rename(instance, filename):
return f'grant_management/ScientificReport/Project-{instance.project.key}-{filename}'
class ScientificReport(AbstractProjectReport):
file = models.FileField(storage=S3Boto3Storage(), upload_to=scientific_report_file_rename,
validators=[*management_file_validator()],
blank=True, null=True)
class LaySummaryType(CreateModifyOn):
name = models.CharField(max_length=10,
help_text='Type of lay summary which could be used within the application to decide how the'
' summary is used',
unique=True)
description = models.CharField(max_length=100, help_text='Description of the type of lay summary')
def __str__(self):
return self.name
class LaySummary(AbstractProjectDueReceivedDate):
text = models.TextField(help_text='Lay summary text', null=True, blank=True)
lay_summary_type = models.ForeignKey(LaySummaryType, help_text='Type of the lay summary', blank=True, null=True,
on_delete=models.PROTECT)
author = models.ForeignKey(PhysicalPerson, help_text='Person who wrote the lay summary',
blank=True, null=True, on_delete=models.PROTECT)
def __str__(self):
return f'{self.text[:20]}'
class Meta:
verbose_name_plural = 'Lay Summaries'
class BlogPost(AbstractProjectDueReceivedDate):
title = models.CharField(max_length=1024, help_text='Title of the blog post', null=True, blank=True)
text = models.TextField(help_text='Blog post text', null=True, blank=True)
author = models.ForeignKey(PhysicalPerson, help_text='Person who wrote the blog post',
blank=True, null=True, on_delete=models.PROTECT)
def media_list(self):
if self.id:
return self.medium_set.all().order_by('received_date')
else:
return []
class Tag(CreateModifyOn):
name = models.CharField(max_length=1024, help_text='Title of the blog post', null=True, blank=True)
def __str__(self):
return f'{self.name}'
class License(CreateModifyOn):
name = models.CharField(max_length=100,
help_text='License name (e.g. Creative Commons Attribution Non Commercial Share Alike 4.0 International)',
unique=True)
spdx_identifier = models.CharField(max_length=100,
help_text='Identifier as per https://spdx.org/licenses/ CC-BY-NC-SA-4.0',
unique=True)
public_text = models.TextField(
help_text='Explanatory text for this license. Include the logo and URL to license text.',
null=True, blank=True)
def __str__(self):
return f'{self.name}'
def medium_file_rename(instance, filename):
return f'grant_management/Medium/Project-{instance.project.key}-{filename}'
class Medium(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project that this medium belongs to', on_delete=models.PROTECT)
received_date = models.DateField(help_text='Date that the medium was received')
photographer = models.ForeignKey(PhysicalPerson, help_text='Person who took the photo/video',
on_delete=models.PROTECT)
license = models.ForeignKey(License, help_text='License',
on_delete=models.PROTECT, null=True, blank=True)
copyright = models.CharField(max_length=1024,
help_text='Owner of copyright if it is not the photographer (e.g. institution)',
null=True, blank=True)
file = models.FileField(storage=S3Boto3Storage(), upload_to=medium_file_rename,
validators=[*management_file_validator()])
file_md5 = models.CharField(max_length=32, null=True, blank=True)
file_web = models.FileField(storage=S3Boto3Storage(), upload_to=medium_file_rename, null=True)
blog_posts = models.ManyToManyField(BlogPost, help_text='Which blog posts this image belongs to', blank=True)
tags = models.ManyToManyField(Tag, help_text='Which tags this image belongs to', blank=True)
descriptive_text = models.TextField(
help_text='Description of this media, if provided. Where was it taken, context, etc.', null=True, blank=True)
key_image = models.BooleanField(default=False, help_text="Select as a key image to be displayed on website")
primary_image = models.BooleanField(default=False, help_text="Select as a primary image on website")
uploaded = models.BooleanField(default=False, help_text="Uploaded to media gallery")
class Meta:
verbose_name_plural = 'Media'
def __str__(self):
return f'{self.project}-{self.photographer}'
def save(self, *args, **kwargs):
self.file_md5 = calculate_md5_from_file_field(self.file)
# Be sure only one primary_image per project
if self.primary_image:
with transaction.atomic():
Medium.objects.filter(
Q(primary_image=True) &
Q(project=self.project)
).update(primary_image=False)
if self.file.name.lower().endswith(tuple(['jpg', 'jpeg', 'png'])):
try:
im = Image.open(self.file)
if im._getexif():
orientation = 0
for orientation in ExifTags.TAGS.keys():
if ExifTags.TAGS[orientation] == 'Orientation':
break
exif = dict(im._getexif().items())
if orientation in exif.keys():
if exif[orientation] == 3:
im = im.rotate(180, expand=True)
elif exif[orientation] == 6:
im = im.rotate(270, expand=True)
elif exif[orientation] == 8:
im = im.rotate(90, expand=True)
out = BytesIO()
if self.file.name.lower().endswith('png'):
im = im.convert('RGB')
im.save(out, format='JPEG', quality=75)
out.seek(0)
self.file_web = InMemoryUploadedFile(
out, 'ImageField', "%s_web.jpeg" % self.file.name.split('.')[0], 'image/jpeg', sys.getsizeof(out), None
)
except (UnidentifiedImageError) as e:
logger.warning(f"Error: {e}; Can not save smaller image for web!")
super().save(*args, **kwargs)
def delete(self, *args, **kwargs):
with transaction.atomic():
MediumDeleted.objects.create(**{'original_id': self.id})
delete_result = super().delete(*args, **kwargs)
return delete_result
class MediumDeleted(CreateModifyOn):
original_id = models.IntegerField(help_text='ID of the delete Medium.ID. Used to return them to the '
'SPI Media Gallery or other software',
unique=True # The same ID cannot be deleted twice
)
class Meta:
verbose_name_plural = 'MediaDeleted'
class SocialNetwork(CreateModifyOn):
name = models.CharField(max_length=100,
help_text='Outreach name (e.g. Twitter, Facebook, Instagram, Blog)')
def __str__(self):
return f'{self.name}'
def icon(self):
return f'external/icons/{self.name.lower()}.png'
def outreach_file_rename(instance, filename):
return f'grant_management/Outreach/Project-{instance.project.key}-{filename}'
class ProjectSocialNetwork(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which this outreach page is related',
on_delete=models.PROTECT)
title = models.CharField(max_length=1000, help_text='Title of outreach', null=True, blank=True)
social_network = models.ForeignKey(SocialNetwork, help_text='Outreach with information about the project',
on_delete=models.PROTECT)
url = models.URLField(help_text='URL of outreach (e.g. https://twitter.com/SwissPolar)', null=True,
blank=True)
file = models.FileField(storage=S3Boto3Storage(), upload_to=outreach_file_rename,
blank=True, null=True)
published_date = models.DateField(help_text='Date on which the outreach was published', null=True, blank=True)
def __str__(self):
return f'{self.project}-{self.social_network}'
def generate_doi_link(doi):
return f'https://doi.org/{doi}'
class Publication(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which the publication is related',
on_delete=models.PROTECT)
doi = models.CharField(max_length=100, help_text='Digital object identifier of publication', null=True, blank=True)
reference = models.CharField(max_length=1000, help_text='Full reference of publication', null=True, blank=True)
title = models.CharField(max_length=1000, help_text='Title of publication')
published_date = models.DateField(help_text='Date on which the resource was published', null=True, blank=True)
def __str__(self):
return '{}'.format(self.title)
def doi_link(self):
return generate_doi_link(self.doi)
class Dataset(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which is the dataset is related',
on_delete=models.PROTECT)
doi = models.CharField(max_length=100, help_text='Digital object identifier of dataset', null=True, blank=True)
reference = models.CharField(max_length=1000, help_text='Full reference of dataset', null=True, blank=True)
url = models.URLField(help_text='URL of dataset if it does not have a DOI', null=True, blank=True)
title = models.CharField(max_length=1000, help_text='Title of dataset')
published_date = models.DateField(help_text='Date on which dataset was published', null=True, blank=True)
def __str__(self):
return '{}'.format(self.title)
def doi_link(self):
return generate_doi_link(self.doi)
class FieldNote(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which is the fieldnote is related',
on_delete=models.PROTECT)
url = models.URLField(help_text='URL of fieldnote', null=True, blank=True)
title = models.CharField(max_length=1000, help_text='Title of fieldnote')
def __str__(self):
return '{}'.format(self.title)
class MilestoneCategory(CreateModifyOn):
name = models.CharField(max_length=40)
created_by = models.ForeignKey(User, help_text='User that created the category', on_delete=models.PROTECT)
def __str__(self):
return self.name
class Milestone(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which the milestone is related',
on_delete=models.PROTECT)
due_date = models.DateField()
category = models.ForeignKey(MilestoneCategory, help_text='Which category is this',
on_delete=models.PROTECT)
text = models.CharField(max_length=200, blank=True, null=True)
history = HistoricalRecords()
def __str__(self):
return self.text
class Location(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project that the coordinate belongs to',
on_delete=models.PROTECT,
related_name='project_location')
latitude = models.DecimalField(decimal_places=2, max_digits=6,
validators=[MinValueValidator(-90),
MaxValueValidator(90)]
)
longitude = models.DecimalField(decimal_places=2, max_digits=7,
validators=[MinValueValidator(-180),
MaxValueValidator(180)])
name = models.CharField(max_length=100)
class Meta:
unique_together = (('project', 'latitude', 'longitude', 'name'),)
def __str__(self):
return f'{self.name} ({self.latitude}, {self.longitude})'
class CoInvestors(CreateModifyOn):
project = models.ForeignKey(Project, help_text='Project to which the publication is related',
on_delete=models.PROTECT,
related_name='project_person')
co_investigator = models.ForeignKey(PhysicalPerson, help_text='Co-Investigator',
on_delete=models.PROTECT, blank=True, null=True)
organisation = models.ForeignKey(Organisation, blank=True, null=True, on_delete=models.PROTECT)
organisation_text = models.CharField(max_length=100, help_text='if organisation not found add here', null=True, blank=True)
def __str__(self):
return f'{self.co_investor}-{self.organisation}'
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,065 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/admin.py | from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from project_core.admin import SimpleHistoryAdminFieldChanges
from .models import Reviewer, ProposalEvaluation, CallEvaluation, Criterion, CriterionCallEvaluation
class ProposalEvaluationAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('proposal__title', 'allocated_budget', 'panel_remarks', 'panel_recommendation', 'board_decision', )
list_display = (
'proposal', 'allocated_budget', 'panel_remarks', 'feedback_to_applicant', 'panel_recommendation',
'board_decision', 'decision_date', 'created_on', 'modified_on')
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes', )
class ReviewerAdmin(admin.ModelAdmin):
search_fields = ('user__username', 'person__first_name', 'person__surname', 'person__orcid', )
list_display = ('user', 'person', 'call_list', 'proposal_list',)
filter_vertical = ('calls', 'proposals',)
def call_list(self, obj):
return ', '.join([str(call) for call in obj.calls.all()])
def proposal_list(self, obj):
return ', '.join([str(proposal) for proposal in obj.proposals.all()])
class CallEvaluationAdmin(admin.ModelAdmin):
search_fields = ('call__long_name', 'post_panel_management_table', )
list_display = ('call', 'panel_date', 'post_panel_management_table', 'closed_date', 'closed_user')
class CriterionAdmin(admin.ModelAdmin):
search_fields = ('name', 'description', )
list_display = ('name', 'description')
class CriterionCallEvaluationAdmin(admin.ModelAdmin):
search_fields = ('call_evaluation__call__long_name', 'criterion__name', )
list_display = ('call_evaluation', 'criterion', 'enabled', 'order')
admin.site.register(Reviewer, ReviewerAdmin)
admin.site.register(ProposalEvaluation, ProposalEvaluationAdmin)
admin.site.register(CallEvaluation, CallEvaluationAdmin)
admin.site.register(Criterion, CriterionAdmin)
admin.site.register(CriterionCallEvaluation, CriterionCallEvaluationAdmin)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,066 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0016_refactor_stepdate.py | # Generated by Django 2.2.6 on 2019-10-04 16:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0015_refactor_step'),
]
operations = [
migrations.CreateModel(
name='Step',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(help_text='Date and time of notable date', max_length=64)),
('call', models.ForeignKey(help_text='Step within a call', on_delete=django.db.models.deletion.PROTECT, to='project_core.Call')),
],
),
migrations.RemoveField(
model_name='steptype',
name='call',
),
migrations.DeleteModel(
name='StepDate',
),
migrations.AddField(
model_name='step',
name='step',
field=models.ForeignKey(help_text='Name of step', max_length=128, on_delete=django.db.models.deletion.PROTECT, to='project_core.StepType'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,067 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0084_proposal_overarching_project.py | # Generated by Django 2.2.6 on 2019-11-27 15:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0083_call_project_overarching_question'),
]
operations = [
migrations.AddField(
model_name='proposal',
name='overarching_project',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.ExternalProject'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,068 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/homepage.py | from django.shortcuts import redirect
from django.urls import reverse
from django.views import View
from project_core.templatetags.request_is_reviewer import request_is_reviewer
class Homepage(View):
def get(self, request, *args, **kwargs):
if request_is_reviewer(request):
return redirect(reverse('logged-proposal-list'))
else:
return redirect(reverse('logged-news'))
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,069 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/forms/locations.py | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Field
from django import forms
from django.forms import BaseInlineFormSet, inlineformset_factory
from grant_management.models import Location
from project_core.models import Project
class LocationModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.disable_csrf = True # checked in the higher form level
self.helper.layout = Layout(
Div(
Div('project', hidden=True),
Div('id', hidden=True),
Div(Field('DELETE', hidden=True)),
css_class='row', hidden=True
),
Div(
Div('name', css_class='col-6'),
Div('latitude', css_class='col-3'),
Div('longitude', css_class='col-3'),
css_class='row'
),
)
class Meta:
model = Location
fields = ['project', 'name', 'latitude', 'longitude']
class LocationsFormSet(BaseInlineFormSet):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_tag = False
def get_queryset(self):
return super().get_queryset().order_by('name')
LocationsInlineFormSet = inlineformset_factory(Project, Location, form=LocationModelForm,
formset=LocationsFormSet,
min_num=1, extra=0, can_delete=True)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,070 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/common/__init__.py | from . import autocomplete
from . import proposal | {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,071 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0033_proposal_timeframe_chnages.py | # Generated by Django 2.2.6 on 2019-10-21 09:08
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('project_core', '0032_add_date_created_source-keywords'),
]
operations = [
migrations.RemoveField(
model_name='proposal',
name='duration',
),
migrations.RemoveField(
model_name='proposal',
name='start_timeframe',
),
migrations.AddField(
model_name='proposal',
name='duration_months',
field=models.DecimalField(decimal_places=1, help_text='Period of time expected that the proposed project will last in months', max_digits=5),
preserve_default=False,
),
migrations.AddField(
model_name='proposal',
name='provisional_end_date',
field=models.DateField(help_text='Approximate date on which the proposed project is expected to end'),
preserve_default=False,
),
migrations.AddField(
model_name='proposal',
name='provisional_start_date',
field=models.DateField(help_text='Approximate date on which the proposed project is expected to start'),
preserve_default=False,
),
migrations.AlterField(
model_name='organisation',
name='source',
field=models.ForeignKey(help_text='Source from which the organisation has originated', on_delete=django.db.models.deletion.PROTECT, to='project_core.Source'),
),
migrations.AlterField(
model_name='source',
name='source',
field=models.CharField(help_text='Source from which a UID or item may originate', max_length=200),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,072 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0114_makes_given_name_surname_not_unique_together_orcid_unique.py | # Generated by Django 3.0.3 on 2020-03-24 15:18
import django.core.validators
from django.db import migrations, models
import project_core.utils.orcid
class Migration(migrations.Migration):
dependencies = [
('project_core', '0113_changes_orcid_field_name'),
]
operations = [
migrations.AlterField(
model_name='historicalphysicalperson',
name='orcid',
field=models.CharField(db_index=True, help_text='Orcid ID', max_length=19, null=True, validators=[project_core.utils.orcid.raise_error_if_orcid_invalid, django.core.validators.RegexValidator(code='Invalid format', message='Invalid format for ORCID iD. E.g.: 0000-0002-1825-0097.', regex='^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$')]),
),
migrations.AlterField(
model_name='physicalperson',
name='orcid',
field=models.CharField(help_text='Orcid ID', max_length=19, null=True, unique=True, validators=[project_core.utils.orcid.raise_error_if_orcid_invalid, django.core.validators.RegexValidator(code='Invalid format', message='Invalid format for ORCID iD. E.g.: 0000-0002-1825-0097.', regex='^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$')]),
),
migrations.AlterUniqueTogether(
name='physicalperson',
unique_together=set(),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,073 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0072_auto_20230213_0931.py | # Generated by Django 3.2.16 on 2023-02-13 08:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0071_auto_20221107_1715'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('name', models.CharField(blank=True, help_text='Title of the blog post', max_length=1024, null=True)),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='medium',
name='tags',
field=models.ManyToManyField(blank=True, help_text='Which tags this image belongs to', to='grant_management.Tag'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,074 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/comments/migrations/0027_improve_paths_object_storage_for_comment_attachments.py | # Generated by Django 3.0.3 on 2020-04-02 14:36
import comments.models
from django.db import migrations, models
import storages.backends.s3boto3
class Migration(migrations.Migration):
dependencies = [
('comments', '0026_uses_function_to_rename_file'),
]
operations = [
migrations.AlterField(
model_name='callattachment',
name='file',
field=models.FileField(storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=comments.models.call_attachment_rename),
),
migrations.AlterField(
model_name='projectattachment',
name='file',
field=models.FileField(storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=comments.models.proposal_evaluation_rename),
),
migrations.AlterField(
model_name='proposalevaluationattachment',
name='file',
field=models.FileField(storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=comments.models.proposal_evaluation_rename),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,075 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0169_make_project_funding_instrument_not_nullable.py | # Generated by Django 3.2.3 on 2021-11-11 14:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0168_add_funding_instrument'),
]
operations = [
migrations.AlterField(
model_name='historicalproject',
name='funding_instrument',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='Funding instrument to which the project belongs', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.fundinginstrument'),
),
migrations.AlterField(
model_name='project',
name='funding_instrument',
field=models.ForeignKey(help_text='Funding instrument to which the project belongs', on_delete=django.db.models.deletion.PROTECT, to='project_core.fundinginstrument'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,076 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/tests/views/logged/test_user.py | from django.test import TestCase
from django.urls import reverse
from project_core.tests import database_population
class TestUserList(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(reverse('logged-user-list'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, self._user.username)
self.assertContains(response, 'Management')
class TestUserDetail(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(reverse('logged-user-detail', kwargs={'pk': self._user.pk}))
self.assertContains(response, self._user.username)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,077 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0127_allocated_budget_project_status_default_change.py | # Generated by Django 3.0.7 on 2020-06-23 10:20
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0126_add_close_project_on_by_fields'),
]
operations = [
migrations.AlterField(
model_name='historicalproject',
name='allocated_budget',
field=models.DecimalField(decimal_places=2, default=0, help_text='Budget allocated to project', max_digits=10, validators=[django.core.validators.MinValueValidator(0)]),
preserve_default=False,
),
migrations.AlterField(
model_name='historicalproject',
name='status',
field=models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed'), ('Aborted', 'Aborted')], default='Ongoing', help_text='Status of a project', max_length=30),
),
migrations.AlterField(
model_name='project',
name='allocated_budget',
field=models.DecimalField(decimal_places=2, default=0, help_text='Budget allocated to project', max_digits=10, validators=[django.core.validators.MinValueValidator(0)]),
preserve_default=False,
),
migrations.AlterField(
model_name='project',
name='status',
field=models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed'), ('Aborted', 'Aborted')], default='Ongoing', help_text='Status of a project', max_length=30),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,078 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/tests/forms/test_call_question.py | from django.test import TestCase
from project_core.forms.call_question import CallQuestionForm
from project_core.tests import database_population
from project_core.tests.utils_for_tests import dict_to_multivalue_dict
class CallQuestionFormTest(TestCase):
def setUp(self):
self._call = database_population.create_call()
self._call_part = database_population.create_call_part(self._call)
def test_create_call_part(self):
call_question = database_population.create_call_question(self._call_part)
new_question_text = 'How far will you walk - edited?'
call_question_data = dict_to_multivalue_dict(
{'call': self._call,
'call_part': self._call_part,
'question_text': new_question_text,
'question_description': 'In meters please',
'order': 10
})
call_question_form = CallQuestionForm(data=call_question_data, instance=call_question, call_part_pk=self._call_part.pk)
self.assertTrue(call_question_form.is_valid())
call_question = call_question_form.save()
call_question.refresh_from_db()
self.assertEqual(call_question.question_text, new_question_text)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,079 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/tests/test_views.py | from datetime import datetime, date
from django.test import TestCase
from django.urls import reverse
from ProjectApplication import settings
from evaluation.models import ProposalEvaluation, CallEvaluation, Criterion
from evaluation.views import CallEvaluationValidation
from project_core.models import Proposal, ProposalStatus, Project
from project_core.tests import database_population
from project_core.tests.utils_for_tests import dict_to_multivalue_dict
class CallEvaluationSummaryViewTest(TestCase):
def setUp(self):
pass
def test_check_all_submitted_proposals_have_eligibility(self):
proposal = database_population.create_proposal()
proposal.eligibility = Proposal.ELIGIBILITYNOTCHECKED
proposal.proposal_status = ProposalStatus.objects.get(name=settings.PROPOSAL_STATUS_SUBMITTED)
proposal.save()
proposals = Proposal.objects.filter(uuid=proposal.uuid)
# Expects one Proposal that is submitted but eligibility not checked...
check_result = CallEvaluationValidation._check_all_submitted_proposals_have_eligibility_set(proposals)
self.assertEqual(check_result['proposals'].count(), 1)
self.assertEqual(check_result['proposals'][0], proposal)
# Sets it not eligible
proposal.eligibility = Proposal.NOTELIGIBLE
proposal.save()
# Then all good for this test
check_result = CallEvaluationValidation._check_all_submitted_proposals_have_eligibility_set(proposals)
self.assertEqual(check_result['proposals'].count(), 0)
def test_check_eligible_proposals_have_evaluation(self):
proposal = database_population.create_proposal()
proposal.eligibility = Proposal.ELIGIBILITYNOTCHECKED
proposal.proposal_status = ProposalStatus.objects.get(name=settings.PROPOSAL_STATUS_SUBMITTED)
proposal.save()
proposals = Proposal.objects.filter(uuid=proposal.uuid)
# Expects one proposal that is eligible but doesn't have a proposal evaluation
check_result = CallEvaluationValidation._check_all_submitted_proposals_have_eligibility_set(proposals)
self.assertEqual(check_result['proposals'].count(), 1)
proposal_evaluation = ProposalEvaluation()
proposal_evaluation.proposal = proposal
proposal_evaluation.save()
proposal.eligibility = Proposal.ELIGIBLE
proposal.save()
proposals = Proposal.objects.filter(uuid=proposal.uuid)
# Now it has the proposal evaluation, it's all good
check_result = CallEvaluationValidation._check_all_submitted_proposals_have_eligibility_set(proposals)
self.assertEqual(check_result['proposals'].count(), 0)
class ProposalEvaluationUpdateTest(TestCase):
def setUp(self):
self._proposal = database_population.create_proposal()
self._call_evaluation = CallEvaluation()
self._call_evaluation.call = self._proposal.call
self._call_evaluation.panel_date = datetime.today()
self._call_evaluation.save()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-proposal-evaluation-add') + f'?proposal={self._proposal.id}')
self.assertEqual(response.status_code, 200)
def test_proposal_evaluation_detail_permission_denied(self):
client = database_population.create_reviewer_logged_client()
response = client.get(reverse('logged-proposal-evaluation-add') + f'?proposal={self._proposal.id}')
self.assertEqual(response.status_code, 302)
self.assertTrue(response.url.startswith(reverse('accounts-login')))
def test_proposal_evaluation_post_permission_denied(self):
client = database_population.create_reviewer_logged_client()
response = client.post(reverse('logged-proposal-evaluation-add'), kwargs={'pk': self._proposal.id})
self.assertEqual(response.status_code, 302)
self.assertTrue(response.url.startswith(reverse('accounts-login')))
def test_proposal_evaluation_create(self):
reviewer = database_population.create_reviewer()
data = dict_to_multivalue_dict({'proposal_evaluation_form-proposal': self._proposal.id,
'proposal_evaluation_form-reviewers': [reviewer.id]})
response = self._client_management.post(
reverse('logged-proposal-evaluation-update', kwargs={'pk': self._proposal.id}),
data=data)
self.assertEqual(response.status_code, 200)
def test_proposal_evaluation_update_post_permission_denied(self):
client = database_population.create_management_logged_client()
self._create_proposal_evaluation(self._proposal)
self._call_evaluation.close(database_population.create_management_user())
response = client.post(reverse('logged-proposal-evaluation-update', kwargs={'pk': self._proposal.id}))
self.assertEqual(response.status_code, 403)
def test_proposal_evaluation_update_get_permission_denied(self):
client = database_population.create_management_logged_client()
self._create_proposal_evaluation(self._proposal)
self._call_evaluation.close(database_population.create_management_user())
response = client.get(
reverse('logged-proposal-evaluation-update', kwargs={'pk': self._proposal.proposalevaluation.id}))
self.assertEqual(response.status_code, 403)
@staticmethod
def _create_proposal_evaluation(proposal):
proposal_evaluation = ProposalEvaluation()
proposal_evaluation.proposal = proposal
proposal_evaluation.board_decision = ProposalEvaluation.BOARD_DECISION_FUND
proposal_evaluation.panel_recommendation = ProposalEvaluation.PANEL_RECOMMENDATION_FUND
proposal_evaluation.allocated_budget = 20_000
proposal_evaluation.save()
class ProposalEvaluationListTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(reverse('logged-evaluation-list'))
self.assertEqual(response.status_code, 200)
class CallEvaluationUpdateTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
self._reviewer = database_population.create_reviewer()
self._criteria = database_population.create_evaluation_criteria()
def test_get(self):
call_evaluation = CallEvaluation()
call_evaluation.call = self._proposal.call
call_evaluation.panel_date = datetime.today()
call_evaluation.save()
response = self._client_management.get(
reverse('logged-call-evaluation-update', kwargs={'pk': call_evaluation.id}))
self.assertEqual(response.status_code, 200)
def test_post(self):
data = dict_to_multivalue_dict({'call_evaluation_form-call': self._proposal.call.id,
'call_evaluation_form-panel_date': '16-03-2020',
'call_evaluation_form-evaluation_sheet': [''],
'call_evaluation_form-reviewers': [self._reviewer.id],
'call_evaluation_form-criteria': [self._criteria[0].id],
'save': 'Save Call Evaluation'})
self.assertEqual(CallEvaluation.objects.all().count(), 0)
response = self._client_management.post(
reverse('logged-call-evaluation-add') + f'?call={self._proposal.call.id}', data=data)
call_evaluation = self._proposal.call.callevaluation
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url, reverse('logged-call-evaluation-detail', kwargs={'pk': call_evaluation.id}))
self.assertEqual(CallEvaluation.objects.all().count(), 1)
self.assertEqual(call_evaluation.panel_date, date(2020, 3, 16))
def test_post_permission_denied(self):
reviewer_client = database_population.create_reviewer_logged_client()
data = dict_to_multivalue_dict({'call_evaluation_form-call': self._proposal.call.id,
'call_evaluation_form-panel_date': '16-03-2020',
'call_evaluation_form-evaluation_sheet': [''],
'save': 'Save Call Evaluation'})
response = reviewer_client.post(
reverse('logged-call-evaluation-add') + f'?call={self._proposal.call.id}', data=data)
self.assertEqual(response.status_code, 302)
self.assertTrue(response.url.startswith(reverse('accounts-login')))
class ProposalListTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-call-evaluation-list-proposals', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['call'], self._proposal.call)
self.assertEqual(response.context['proposals'].count(), 0)
class ProposalEvaluationDetailTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
proposal_evaluation = ProposalEvaluation()
proposal_evaluation.proposal = self._proposal
proposal_evaluation.save()
response = self._client_management.get(
reverse('logged-proposal-evaluation-detail', kwargs={'pk': proposal_evaluation.id}))
self.assertEqual(response.status_code, 200)
class CallEvaluationDetailTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get_context_data(self):
call_evaluation = CallEvaluation()
call_evaluation.call = self._proposal.call
call_evaluation.panel_date = datetime.today()
call_evaluation.save()
response = self._client_management.get(
reverse('logged-call-evaluation-detail', kwargs={'pk': call_evaluation.id}))
self.assertEqual(response.status_code, 200)
class ProposalDetailTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-call-evaluation-proposal-detail', kwargs={'pk': self._proposal.id}))
self.assertEqual(response.status_code, 200)
self.assertTrue(response.context['force_eligibility_form_displayed'])
class CallEvaluationSummaryTest(TestCase):
def setUp(self):
self._user = database_population.create_management_user()
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-call-evaluation-summary', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
class CallEvaluationValidationTest(TestCase):
def setUp(self):
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_get_context_data(self):
proposal_submitted = ProposalStatus.objects.get(name=settings.PROPOSAL_STATUS_SUBMITTED)
self._proposal.proposal_status = proposal_submitted
self._proposal.save()
call_evaluation = CallEvaluation()
call_evaluation.call = self._proposal.call
call_evaluation.panel_date = datetime.today()
call_evaluation.save()
# Checks that 1 proposal, 0 eligible...
response = self._client_management.get(
reverse('logged-call-evaluation-validation', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
context = response.context
self.assertEqual(context['all_good'], False)
self.assertEqual(context['can_close'], False)
self.assertEqual(context['total_number_of_submitted'], 1)
self.assertEqual(context['total_number_of_eligible'], 0)
self.assertEqual(context['total_number_of_funded'], 0)
self.assertEqual(context['total_number_of_eligible_not_funded'], 0)
# Makes the proposal eligible
self._proposal.eligibility = Proposal.ELIGIBLE
self._proposal.save()
# Checks that 1 proposal, 1 eligible, 0 funded
response = self._client_management.get(
reverse('logged-call-evaluation-validation', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
context = response.context
self.assertEqual(context['all_good'], False)
self.assertEqual(context['can_close'], False)
self.assertEqual(context['total_number_of_submitted'], 1)
self.assertEqual(context['total_number_of_eligible'], 1)
self.assertEqual(context['total_number_of_funded'], 0)
self.assertEqual(context['total_number_of_eligible_not_funded'], 1)
# Funds the proposal. In reality the form would force the attached letter before it's funded, etc.
# but here accessing to the model straight away all the rest is not needed
proposal_evaluation = ProposalEvaluation()
proposal_evaluation.proposal = self._proposal
proposal_evaluation.board_decision = ProposalEvaluation.BOARD_DECISION_FUND
proposal_evaluation.save()
# Checks that 1 proposal, 1 eligible, 1 funded
response = self._client_management.get(
reverse('logged-call-evaluation-validation', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
context = response.context
self.assertEqual(context['all_good'], False)
self.assertEqual(context['can_close'], False)
self.assertEqual(context['total_number_of_submitted'], 1)
self.assertEqual(context['total_number_of_eligible'], 1)
self.assertEqual(context['total_number_of_funded'], 1)
self.assertEqual(context['total_number_of_eligible_not_funded'], 0)
class CallCloseEvaluationTest(TestCase):
def setUp(self):
self._client = database_population.create_management_logged_client()
self._proposal = database_population.create_proposal()
def test_post(self):
call_evaluation = CallEvaluation()
call_evaluation.call = self._proposal.call
call_evaluation.panel_date = datetime.today()
call_evaluation.save()
# Makes the proposal eligible
self._proposal.eligibility = Proposal.ELIGIBLE
self._proposal.save()
# Funds the proposal. In reality the form would force the attached letter before it's funded, etc.
# but here accessing to the model straight away all the rest is not needed
proposal_evaluation = ProposalEvaluation()
proposal_evaluation.proposal = self._proposal
proposal_evaluation.board_decision = ProposalEvaluation.BOARD_DECISION_FUND
proposal_evaluation.allocated_budget = 20_000
proposal_evaluation.save()
self.assertEqual(Project.objects.all().count(), 0)
response = self._client.post(
reverse('logged-call-close-evaluation', kwargs={'call_id': self._proposal.call.id}))
self.assertEqual(response.status_code, 200)
self.assertEqual(Project.objects.all().count(), 1)
# Verifies created project
project = Project.objects.all()[0]
self.assertEqual(project.title, self._proposal.title)
self.assertEqual(project.location, self._proposal.location)
self.assertEqual(project.start_date, self._proposal.start_date)
self.assertEqual(project.end_date, self._proposal.end_date)
self.assertEqual(project.principal_investigator, self._proposal.applicant)
self.assertEqual(project.principal_investigator, self._proposal.applicant)
self.assertEqual(project.overarching_project, self._proposal.overarching_project)
self.assertEqual(project.allocated_budget, self._proposal.proposalevaluation.allocated_budget)
self.assertEqual(project.status, Project.ONGOING)
self.assertEqual(project.call, self._proposal.call)
self.assertEqual(project.proposal, self._proposal)
# TODO: check project.geographical_areas and project.keywords
class ProposalEligibilityUpdateTest(TestCase):
def setUp(self):
self._proposal = database_population.create_proposal()
self._client_management = database_population.create_management_logged_client()
def test_post(self):
self.assertEqual(self._proposal.eligibility, Proposal.ELIGIBILITYNOTCHECKED)
# Makes self._proposal not-eligible
data = dict_to_multivalue_dict({'eligibility_decision_form-eligible': False,
'eligibility_decision_form-comment': 'Not in the scope of the call',
'save': 'Save Eligibility'
})
response = self._client_management.post(
reverse('logged-proposal-eligibility-update', kwargs={'pk': self._proposal.id}),
data=data)
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url,
reverse('logged-call-evaluation-proposal-detail', kwargs={'pk': self._proposal.id}))
self._proposal.refresh_from_db()
self.assertEqual(self._proposal.eligibility, Proposal.NOTELIGIBLE)
self.assertEqual(self._proposal.eligibility_comment, 'Not in the scope of the call')
# Makes self._proposal eligible
data = dict_to_multivalue_dict({'eligibility_decision_form-eligible': True,
'eligibility_decision_form-comment': 'Good proposal!',
'save': 'Save Eligibility'
})
response = self._client_management.post(
reverse('logged-proposal-eligibility-update', kwargs={'pk': self._proposal.id}),
data=data)
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url,
reverse('logged-call-evaluation-proposal-detail', kwargs={'pk': self._proposal.id}))
self._proposal.refresh_from_db()
self.assertEqual(self._proposal.eligibility, Proposal.ELIGIBLE)
self.assertEqual(self._proposal.eligibility_comment, 'Good proposal!')
class EvaluationCriteriaList(TestCase):
def setUp(self):
self._criterion = Criterion.objects.create(
name='Feasibility', description='How feasible is the project'
)
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(reverse('logged-evaluation_criteria-list'))
self.assertContains(response, 'Feasibility')
self.assertContains(response, 'How feasible is the project')
class EvaluationCriterionDetail(TestCase):
def setUp(self):
self._criterion = Criterion.objects.create(
name='Feasibility', description='How feasible is the project'
)
self._client_management = database_population.create_management_logged_client()
def test_get(self):
response = self._client_management.get(
reverse('logged-evaluation_criterion-detail', kwargs={'pk': self._criterion.pk}))
self.assertContains(response, 'Feasibility')
self.assertContains(response, 'How feasible is the project')
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,080 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0084_career_stage.py | # Generated by Django 2.2.6 on 2019-11-27 15:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0083_call_project_overarching_question'),
]
operations = [
migrations.RemoveField(
model_name='proposalpartner',
name='career_stage',
),
migrations.AddField(
model_name='personposition',
name='career_stage',
field=models.ForeignKey(default='', help_text='Stage of the person in the career', on_delete=django.db.models.deletion.PROTECT, to='project_core.CareerStage'),
preserve_default=False,
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,081 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0057_mediumdeleted.py | # Generated by Django 3.0.10 on 2020-10-12 14:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0056_rename_file_field_medium'),
]
operations = [
migrations.CreateModel(
name='MediumDeleted',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('original_id', models.IntegerField(help_text='ID of the delete Medium.ID. Used to return them to the SPI Media Gallery or other software', unique=True)),
],
options={
'verbose_name_plural': 'MediaDeleted',
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,082 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/urls.py | from django.urls import path
import evaluation.views
urlpatterns = [
path('logged/evaluation/list/',
evaluation.views.ProposalEvaluationList.as_view(),
name='logged-evaluation-list'),
path('logged/evaluation-criteria/list/',
evaluation.views.EvaluationCriteriaList.as_view(),
name='logged-evaluation_criteria-list'),
path('logged/evaluation-criteria/detail/<int:pk>/',
evaluation.views.EvaluationCriterionDetail.as_view(),
name='logged-evaluation_criterion-detail'),
path('logged/evaluation-criteria/list/<int:pk>/',
evaluation.views.EvaluationCriterionUpdate.as_view(),
name='logged-evaluation_criterion-update'),
path('logged/evaluation-criteria/add/',
evaluation.views.EvaluationCriterionAdd.as_view(),
name='logged-evaluation_criterion-add'),
path('logged/proposal-evaluation/<int:pk>/eligibility/',
evaluation.views.ProposalEligibilityUpdate.as_view(),
name='logged-proposal-eligibility-update'),
path('logged/proposal-evaluation/<int:pk>/',
evaluation.views.ProposalEvaluationDetail.as_view(),
name='logged-proposal-evaluation-detail'),
path('logged/proposal-evaluation/<int:pk>/update/',
evaluation.views.ProposalEvaluationUpdate.as_view(),
name='logged-proposal-evaluation-update'),
path('logged/proposal-evaluation/add/',
evaluation.views.ProposalEvaluationUpdate.as_view(),
name='logged-proposal-evaluation-add'),
path('logged/proposal-evaluation/<int:pk>/comment/add/',
evaluation.views.ProposalCommentAdd.as_view(),
name='logged-proposal-evaluation-comment-add'),
path('logged/call-evaluation/add/',
evaluation.views.CallEvaluationUpdate.as_view(),
name='logged-call-evaluation-add'),
path('logged/call-evaluation/<int:pk>/update/',
evaluation.views.CallEvaluationUpdate.as_view(),
name='logged-call-evaluation-update'),
path('logged/call-evaluation/<int:pk>/',
evaluation.views.CallEvaluationDetail.as_view(),
name='logged-call-evaluation-detail'),
path('logged/call-evaluation/<int:pk>/comment/add/',
evaluation.views.CallEvaluationCommentAdd.as_view(),
name='logged-call-evaluation-comment-add'),
path('logged/call-evaluation/<int:call_id>/list_proposals/',
evaluation.views.ProposalList.as_view(),
name='logged-call-evaluation-list-proposals'),
path('logged/call-evaluation/proposal/<int:pk>/',
evaluation.views.ProposalDetail.as_view(),
name='logged-call-evaluation-proposal-detail'),
path('logged/call-evaluation/<int:call_id>/summary/',
evaluation.views.CallEvaluationSummary.as_view(),
name='logged-call-evaluation-summary'),
path('logged/call-evaluation/<int:call_id>/validation/',
evaluation.views.CallEvaluationValidation.as_view(),
name='logged-call-evaluation-validation'),
path('logged/call-evaluation/<int:call_id>/close/',
evaluation.views.CallCloseEvaluation.as_view(),
name='logged-call-close-evaluation'),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,083 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/utils/utils.py | import hashlib
import io
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.validators import FileExtensionValidator
from django.urls import reverse
def bytes_to_human_readable(num: int) -> str:
if num is None:
return 'Unknown'
for unit in ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB']:
if abs(num) < 1024.0:
if unit == 'bytes':
return '{} {}'.format(num, unit)
else:
return '{:.2f} {}'.format(num, unit)
num /= 1024.0
return '%d %s' % (num, 'YB')
def user_is_in_group_name(user, group_name):
try:
user.groups.get(name=group_name)
return True
except ObjectDoesNotExist:
return False
def create_person_position(orcid, first_name, surname, gender=None, phd_date=None,
academic_title=None, group=None, career_stage=None, organisation_names=None):
from ..models import PhysicalPerson, PersonPosition
"""
Creates a PhysicalPerson (if needed) and a PersonPosition. Returns the PersonPosition.
"""
physical_person, physical_person_created = PhysicalPerson.objects.get_or_create(orcid=orcid)
# Updates any previous information (besides the ORCID that it stays the same or it's creating a new person)
physical_person.first_name = first_name
physical_person.surname = surname
if gender:
physical_person.gender = gender
if phd_date:
physical_person.phd_date = phd_date
physical_person.save()
person_position_filter = {'person': physical_person,
'academic_title': academic_title}
if career_stage:
person_position_filter['career_stage'] = career_stage
if group:
person_position_filter['group'] = group
person_positions = PersonPosition.objects.filter(**person_position_filter)
person_position_found = False
person_position = None
for person_position in person_positions:
if set(person_position.organisation_names.all()) == set(organisation_names):
person_position_found = True
break
if not person_position_found:
person_position = PersonPosition.objects.create(person=physical_person,
academic_title=academic_title,
group=group,
career_stage=career_stage)
if organisation_names:
person_position.organisation_names.set(organisation_names)
assert person_position
person_position.save()
return person_position
def format_date(date):
return f'{date:%d-%m-%Y}'
def file_size_validator(file):
# It can receive _io.BufferedRandom and S3 files
file_size = getattr(file.file, 'size', None)
if file_size is None:
file_size = file.size
limit_mb = 150
limit = limit_mb * 1024 * 1024
if file_size > limit:
raise ValidationError(f'Maximum file size is {bytes_to_human_readable(limit)}')
def management_file_validator():
return [FileExtensionValidator(allowed_extensions=['pdf', 'docx', 'odt', 'jpg', 'jpeg', 'png']),
file_size_validator]
def external_file_validator():
return [FileExtensionValidator(allowed_extensions=['pdf']),
file_size_validator]
def calculate_md5_from_file_field(file_field):
# initial_position = file_field.file.file.pos()
# file_field.file.file.seek(0)
if type(file_field.file.file) == io.BytesIO:
file_contents = file_field.file.file.getvalue()
else:
# This is horrible. It happens when the file is updated
# (at least in our flow)
file_contents = file_field.file.read()
hash_md5 = hashlib.md5(file_contents)
# file_field.file.file.seek(initial_position)
return hash_md5.hexdigest()
def new_person_message() -> str:
new_person_url = reverse('logged-person-position-add')
return f'. <a href="{new_person_url}">Add new person</a>'
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,084 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/template_question.py | from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse
from django.views.generic import CreateView, UpdateView, DetailView, ListView
from project_core.forms.utils import cancel_edit_button
from project_core.models import TemplateQuestion
class TemplateQuestionList(ListView):
model = TemplateQuestion
context_object_name = 'template_questions'
template_name = 'logged/template_question-list.tmpl'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'template-question-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Template questions'}]
return context
class TemplateQuestionMixin:
fields = ['question_text', 'question_description', 'answer_type', 'answer_max_length', 'answer_required']
@property
def success_msg(self):
return NotImplemented
class CrispyNoFormTag:
def get_form(self, form_class=None):
form = super().get_form(form_class)
form.helper = FormHelper()
if form.instance.id:
action = 'Save'
cancel_edit_url = reverse('logged-template-question-detail', kwargs={'pk': form.instance.id})
else:
action = 'Create'
cancel_edit_url = reverse('logged-template-question-add')
form.fields['question_text'].widget.attrs = {'rows': 2}
form.fields['question_description'].widget.attrs = {'rows': 2}
form.helper.layout = Layout(
Div(
Div('question_text', css_class='col-12'),
css_class='row'
),
Div(
Div('question_description', css_class='col-12'),
css_class='row'
),
Div(
Div('answer_type', css_class='col-6'),
Div('answer_max_length', css_class='col-6'),
css_class='row'
),
Div(
Div('answer_required', css_class='col-12'),
css_class='row'
),
Div(
Div(HTML('<br>'), css_class='col-12'),
css_class='row'
),
FormActions(
Submit('save', f'{action} Template Question'),
cancel_edit_button(cancel_edit_url)
)
)
return form
class TemplateQuestionCreateView(TemplateQuestionMixin, CrispyNoFormTag, SuccessMessageMixin, CreateView):
template_name = 'logged/template_question-form.tmpl'
model = TemplateQuestion
success_message = 'Template question created'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'template-questions-add',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Template questions', 'url': reverse('logged-template-question-list')},
{'name': 'Create'}]
return context
class TemplateQuestionUpdateView(TemplateQuestionMixin, CrispyNoFormTag, SuccessMessageMixin, UpdateView):
template_name = 'logged/template_question-form.tmpl'
model = TemplateQuestion
success_message = 'Template question updated'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'template-question-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Template questions', 'url': reverse('logged-template-question-list')},
{'name': 'Edit'}]
return context
class TemplateQuestionDetailView(TemplateQuestionMixin, DetailView):
template_name = 'logged/template_question-detail.tmpl'
model = TemplateQuestion
context_object_name = 'template_question'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'template-question-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Template questions', 'url': reverse('logged-template-question-list')},
{'name': 'Details'}]
return context
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,085 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/utils.py | from django import forms
class ReviewerMultipleChoiceField(forms.ModelMultipleChoiceField):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def label_from_instance(self, obj):
return obj.person | {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,086 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/forms/contacts.py | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit
from dal import autocomplete
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.forms import ModelForm
from django.urls import reverse
from .utils import get_field_information, cancel_edit_button, cancel_button
from ..models import PersonPosition, PhysicalPerson, Contact, Gender
from ..utils.orcid import orcid_div
class ContactForm(ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
person__gender = person__first_name = person__surname = person__orcid = main_email = None
is_edit = self.instance and self.instance.pk and self.instance.person
if is_edit:
person__gender = self.instance.person.gender
person__first_name = self.instance.person.first_name
person__surname = self.instance.person.surname
person__orcid = self.instance.person.orcid
main_email = self.instance.main_email()
cancel_html = cancel_edit_button(reverse('logged-person-position-detail', kwargs={'pk': self.instance.pk}))
else:
cancel_html = cancel_button(reverse('logged-person-position-list'))
self.fields['person__orcid'] = forms.CharField(**get_field_information(PhysicalPerson, 'orcid'),
initial=person__orcid)
self.fields['person__orcid'].required = False
self.fields['person__orcid'].help_text += '. Please add the ORCID iD to avoid duplicates'
self.fields['person__gender'] = forms.ModelChoiceField(Gender.objects.all().order_by('name'),
initial=person__gender)
self.fields['person__first_name'] = forms.CharField(**get_field_information(PhysicalPerson, 'first_name'),
initial=person__first_name)
self.fields['person__surname'] = forms.CharField(**get_field_information(PhysicalPerson, 'surname'),
initial=person__surname)
self.fields['organisation_names'].help_text += '. If the organisation is not listed ' \
'type a new name to create it'
self.fields['email'] = forms.EmailField(initial=main_email, required=False)
self.fields['privacy_policy'].help_text += '. Please make sure that the person has accepted the privacy policy' \
' before adding them'
self.fields['privacy_policy'].required = True
self.helper = FormHelper(self)
self.helper.layout = Layout(
orcid_div('person__orcid'),
Div(
Div('person__gender', css_class='col-1'),
Div('academic_title', css_class='col-1'),
Div('career_stage', css_class='col-2'),
Div('person__first_name', css_class='col-4'),
Div('person__surname', css_class='col-4'),
css_class='row'
),
Div(
Div('organisation_names', css_class='col-12'),
css_class='row'
),
Div(
Div('group', css_class='col-12'),
css_class='row'
),
Div(
Div('email', css_class='col-12'),
css_class='row'
),
Div(
Div('privacy_policy', css_class='col-6'),
Div('contact_newsletter', css_class='col-6'),
css_class='row'
),
Submit('submit', 'Save'),
cancel_html
)
def clean(self):
super().clean()
if self.instance is None or self.instance.pk is None:
# Creating a new one. Let's avoid creating duplicates and inform the user
try:
physical_person = PhysicalPerson.objects.get(
first_name=self.cleaned_data['person__first_name'],
surname=self.cleaned_data['person__surname'])
raise forms.ValidationError('Cannot create this contact: person already exists')
except ObjectDoesNotExist:
pass
def save(self, commit=True):
model = super().save(False)
orcid = self.cleaned_data['person__orcid']
if orcid == '':
orcid = None
if model.person_id:
model.person.orcid = orcid
model.person.gender = self.cleaned_data['person__gender']
model.person.first_name = self.cleaned_data['person__first_name']
model.person.surname = self.cleaned_data['person__surname']
else:
defaults = {
'gender': self.cleaned_data['person__gender'],
'first_name': self.cleaned_data['person__first_name'],
'surname': self.cleaned_data['person__surname']
}
if orcid is not None:
# Use orcid to UPDATE OR create the person with the updated
# name
model.person, created = PhysicalPerson.objects.update_or_create(
orcid=orcid,
defaults=defaults)
else:
# No orcid, if possible re-use a physical person and let's
# hope that no two different people have the same name
model.person, created = PhysicalPerson.objects.update_or_create(**defaults)
if commit:
model.person.save()
model.save()
main_email = self.instance.main_email_model()
if main_email:
if self.cleaned_data['email']:
main_email.entry = self.cleaned_data['email']
main_email.save()
else:
main_email.delete()
elif self.cleaned_data['email']:
main_email, created = Contact.objects.get_or_create(person_position=model,
entry=self.cleaned_data['email'],
method=Contact.EMAIL)
if commit:
model.save()
self.save_m2m()
return model
class Meta:
model = PersonPosition
fields = ['academic_title', 'career_stage', 'group', 'privacy_policy', 'contact_newsletter', 'organisation_names']
widgets = {'organisation_names': autocomplete.ModelSelect2Multiple(url='autocomplete-organisation-names')}
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,087 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0171_make_project_finance_year_not_nullable.py | # Generated by Django 3.2.3 on 2021-11-11 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0170_add_project_finance_year'),
]
operations = [
migrations.AlterField(
model_name='historicalproject',
name='finance_year',
field=models.IntegerField(help_text='Finance year of this project',
null=True),
),
migrations.AlterField(
model_name='project',
name='finance_year',
field=models.IntegerField(help_text='Finance year of this project'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,088 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/management/commands/uploadmediatomediagallery.py | import requests
import filetype
from django.core.management.base import BaseCommand
from grant_management.models import Medium
class Command(BaseCommand):
help = 'Upload all media to the spi media gallery'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
url = "https://media.swisspolar.ch/api/v1/medium/"
for medium in Medium.objects.all():
if medium.tags.exists() and not medium.uploaded:
data = {}
files = {'file': medium.file.open()}
if filetype.is_image(files['file']):
data["medium_type"] = "P"
elif filetype.is_video(files['file']):
data["medium_type"] = "V"
else:
print("Unsupported file type")
continue
data["project"] = f"SPI project/{medium.project.key.split('-')[0]}"
data["photographer_value"] = str(medium.photographer)
data["location_value"] = f"Location/{medium.project.location}"
data["copyright"] = str(medium.copyright)
data["license"] = str(medium.license)
data["datetime_taken"] = medium.received_date.strftime('%Y-%m-%d')
tagstr = ""
for tag in medium.tags.all():
tagstr += f"{tag},"
data["tags_value"] = tagstr[:-1]
response = requests.post(url, data=data, files=files)
if response.status_code == 201:
medium.uploaded = True
medium.save()
print("Medium uploaded")
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,089 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/reporting/migrations/0002_add_reason_missing_data_field.py | # Generated by Django 3.0.10 on 2020-10-23 09:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reporting', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='fundinginstrumentyearmissingdata',
options={'verbose_name_plural': 'Funding Instrument Year Missing Data'},
),
migrations.AddField(
model_name='fundinginstrumentyearmissingdata',
name='description',
field=models.TextField(default='', help_text='Reason that there is missing data. It might be shown in the management'),
preserve_default=False,
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,090 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0179_trace_tracecoordinates.py | # Generated by Django 3.2.14 on 2022-10-14 08:29
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import re
class Migration(migrations.Migration):
dependencies = [
('project_core', '0178_auto_20220708_0904'),
]
operations = [
migrations.CreateModel(
name='Trace',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('name', models.CharField(help_text='Name of the trace', max_length=64, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), 'Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.', 'invalid')])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='TraceCoordinates',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('longitude', models.DecimalField(decimal_places=3, max_digits=14)),
('latitude', models.DecimalField(decimal_places=3, max_digits=14)),
('trace', models.ForeignKey(help_text='Trace that the coordinate belongs to', on_delete=django.db.models.deletion.PROTECT, related_name='trace_coordinates', to='project_core.trace')),
],
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,091 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0011_proposal_uuid.py | # Generated by Django 2.2.6 on 2019-10-02 13:00
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('project_core', '0010_callquestion_question_description'),
]
operations = [
migrations.AddField(
model_name='proposal',
name='uuid',
field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,092 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/financial_key.py | from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse, reverse_lazy
from django.views.generic import ListView, CreateView
from project_core.forms.financial_key import FinancialKeyForm
from project_core.models import FinancialKey
class FinancialKeyListView(ListView):
template_name = 'logged/financial_key-list.tmpl'
context_object_name = 'financial_keys'
model = FinancialKey
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'financial_key-list',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Financial keys'}]
return context
class FinancialKeyAdd(SuccessMessageMixin, CreateView):
template_name = 'logged/financial_key-form.tmpl'
model = FinancialKey
success_message = 'Financial key created'
form_class = FinancialKeyForm
success_url = reverse_lazy('logged-financial-key-list')
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'lists',
'active_subsection': 'financial_key-add',
'sidebar_template': 'logged/_sidebar-lists.tmpl'})
context['breadcrumb'] = [{'name': 'Lists', 'url': reverse('logged-lists')},
{'name': 'Financial keys', 'url': reverse('logged-financial-key-list')},
{'name': 'Create'}]
return context
def form_valid(self, form):
obj = form.save(commit=False)
obj.created_by = self.request.user
return super().form_valid(form) | {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,093 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0132_contact_add_phone.py | # Generated by Django 3.0.8 on 2020-08-03 09:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0131_add_postal_address'),
]
operations = [
migrations.AlterField(
model_name='callquestion',
name='order',
field=models.PositiveIntegerField(help_text='Use this number to order the questions'),
),
migrations.AlterField(
model_name='contact',
name='method',
field=models.CharField(choices=[('Office', 'Office'), ('Mobile', 'Mobile'), ('Email', 'Email'), ('Phone', 'Phone')], help_text='Type of contact method', max_length=30),
),
migrations.AlterField(
model_name='historicalcallquestion',
name='order',
field=models.PositiveIntegerField(help_text='Use this number to order the questions'),
),
migrations.AlterField(
model_name='historicalcontact',
name='method',
field=models.CharField(choices=[('Office', 'Office'), ('Mobile', 'Mobile'), ('Email', 'Email'), ('Phone', 'Phone')], help_text='Type of contact method', max_length=30),
),
migrations.AlterUniqueTogether(
name='contact',
unique_together={('person_position', 'entry', 'method')},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,094 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/comments/migrations/0009_add_category_attachments.py | # Generated by Django 2.2.6 on 2020-02-11 10:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('comments', '0008_proposalattachment_comment_text'),
]
operations = [
migrations.CreateModel(
name='ProposalAttachmentCategory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('comment_category', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='comments.Category')),
('created_by', models.ForeignKey(blank=True, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='comments_proposalattachmentcategory_created_by_related', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='comments_proposalattachmentcategory_modified_by_related', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Proposal Attachment Categories',
},
),
migrations.AddField(
model_name='proposalattachment',
name='category',
field=models.ForeignKey(default=1, help_text='Type of attachment', on_delete=django.db.models.deletion.PROTECT, to='comments.ProposalAttachmentCategory'),
preserve_default=False,
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,095 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0049_organisation_createmodify.py | # Generated by Django 2.2.6 on 2019-10-22 14:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0048_refactored_uid_models'),
]
operations = [
migrations.RemoveField(
model_name='organisation',
name='date_created',
),
migrations.AddField(
model_name='organisation',
name='created_by',
field=models.ForeignKey(blank=True, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_organisation_created_by_related', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='organisation',
name='created_on',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now, help_text='Date and time at which the entry was created'),
preserve_default=False,
),
migrations.AddField(
model_name='organisation',
name='modified_by',
field=models.ForeignKey(blank=True, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_organisation_modified_by_related', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='organisation',
name='modified_on',
field=models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,096 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0003_remove_socialnetwork_identifier.py | # Generated by Django 3.0.3 on 2020-04-06 07:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0002_socialnetwork_identifier'),
]
operations = [
migrations.RemoveField(
model_name='socialnetwork',
name='identifier',
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,097 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0010_makes_signed_by_optional.py | # Generated by Django 3.0.3 on 2020-04-10 10:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
('grant_management', '0009_makes_sent_for_approval_date_optional'),
]
operations = [
migrations.AlterField(
model_name='financialreport',
name='signed_by',
field=models.ForeignKey(blank=True, help_text='Person who signed the finance report', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.PhysicalPerson'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,098 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/migrations/0026_add_call_evaluation_criteria.py | # Generated by Django 3.0.10 on 2020-10-15 09:13
from django.db import migrations
def add_evaluation_criteria(apps, schema_editor):
Criterion = apps.get_model('evaluation', 'Criterion')
Criterion.objects.get_or_create(name='Scientific merit of the project', defaults={
'description': 'What is the scientific merit of the proposed project? Does the project contribute to relevant scientific questions?'})
Criterion.objects.get_or_create(name='Originality of the project', defaults={
'description': 'Novelty and originality of the approach and proposed activities'})
Criterion.objects.get_or_create(name='Feasibility of the project', defaults={
'description': 'Is the proposed scientific methodology feasible under the given environmental, financial and logistic context? What are the risks and how important are they? Is the proposed timeframe and budget realistic?'})
Criterion.objects.get_or_create(name='Experience and expertise of the PIs and partners', defaults={
'description': 'What is the applicant’s track record so far (academic excellence)?; What is the potential for the applicant to benefit from this field trip?; Is the applicant’s environment (institute/lab) and support appropriate for the success of the proposed activity?'})
Criterion.objects.get_or_create(name='Impact of the requested funding', defaults={
'description': 'How important is the additional funding provided by the SPI Exploratory Grant for the successful undertaking of the proposed project? What does the additional funding enable to do and to which extend is this instrumental for the project? Does it add value to the project?'})
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0025_improve_plural_forms'),
]
operations = [
migrations.RunPython(add_evaluation_criteria)
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,099 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0112_physical_person_add_orcid.py | # Generated by Django 3.0.3 on 2020-03-20 15:26
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0111_remove_project_duration_months'),
]
operations = [
migrations.AddField(
model_name='historicalphysicalperson',
name='orcid_id',
field=models.CharField(help_text='Orcid ID', max_length=19, null=True, validators=[django.core.validators.RegexValidator(code='Invalid format', message='Format orcid ID is 0000-0000-0000-0000', regex='^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$')]),
),
migrations.AddField(
model_name='physicalperson',
name='orcid_id',
field=models.CharField(help_text='Orcid ID', max_length=19, null=True, validators=[django.core.validators.RegexValidator(code='Invalid format', message='Format orcid ID is 0000-0000-0000-0000', regex='^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$')]),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,100 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0097_physicalperson_phd_date.py | # Generated by Django 2.2.6 on 2019-12-05 09:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0096_proposal_enddate'),
]
operations = [
migrations.AddField(
model_name='physicalperson',
name='phd_date',
field=models.CharField(blank=True, help_text='Date (mm/yyyy) on which PhD awarded or expected', max_length=20, null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,101 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0046_auto_uuid_null.py | # Generated by Django 2.2.6 on 2019-10-22 09:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0045_created_modified_on_defaults'),
]
operations = [
migrations.AlterField(
model_name='keywordsource',
name='uuid',
field=models.UUIDField(blank=True, db_index=True, null=True, unique=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,102 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/ProjectApplication/settings.py | """
Django settings for ProjectApplication project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import datetime
import mimetypes
import os
import pathlib
import tempfile
from django.contrib.messages import constants as messages
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
# Application definition
INSTALLED_APPS = [
'dal',
'dal_select2',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'crispy_forms',
'simple_history',
'phonenumber_field',
'axes',
'project_core',
'variable_templates',
'evaluation',
'comments',
'colours',
'grant_management',
'reporting',
'rest_framework',
'django_filters',
'ckeditor',
'ckeditor_uploader',
'django_otp',
'django_otp.plugins.otp_totp',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'project_core.middleware.login.LoginRequiredMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'simple_history.middleware.HistoryRequestMiddleware',
# AxesMiddleware should be the last middleware in the MIDDLEWARE list.
# It only formats user lockout messages and renders Axes lockout responses
# on failed user authentication attempts from login views.
# If you do not want Axes to override the authentication response
# you can skip installing the middleware and use your own views.
'axes.middleware.AxesMiddleware',
'django_otp.middleware.OTPMiddleware',
]
AUTHENTICATION_BACKENDS = [
# AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.
'axes.backends.AxesBackend',
# Django ModelBackend is the default authentication backend.
'django.contrib.auth.backends.ModelBackend',
]
ROOT_URLCONF = 'ProjectApplication.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'project_core.processors.navbar_background.background',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'ProjectApplication.wsgi.application'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
},
'loggers': {
'project_core': {
'handlers': ['console'],
'level': 'WARNING',
'propagate': True,
},
},
}
# https://docs.djangoproject.com/en/3.0/ref/settings/#secure-proxy-ssl-header
# Make sure that nginx is doing what's described in the link above
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': (
'django_filters.rest_framework.DjangoFilterBackend',
'rest_framework.filters.OrderingFilter',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 12
}
def secrets_file(file_name, optional_path=None):
""" First try optional_path, then $HOME/.file_name, then /run/secrets/file_name, else raises an exception"""
if optional_path is not None:
file_path_in_optional = os.path.join(optional_path, file_name)
if os.path.exists(file_path_in_optional):
return file_path_in_optional
file_path_in_home_directory = os.path.join(str(pathlib.Path.home()), "." + file_name)
if os.path.exists(file_path_in_home_directory):
return file_path_in_home_directory
file_path_in_run_secrets = os.path.join("/run/secrets", file_name)
if os.path.exists(file_path_in_run_secrets):
return file_path_in_run_secrets
raise FileNotFoundError("Configuration for {} doesn't exist".format(file_name))
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
if os.getenv('FORCE_SQLITE3_DATABASE', False):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': secrets_file('project_application_mysql.conf', '/etc/mysql'),
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4',
},
'TEST': {
'NAME': 'test_projects'
}
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
cache_directory = os.path.join(tempfile.gettempdir(), 'project-application-cache')
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': cache_directory,
'TIMEOUT': 300,
'OPTIONS': {
'MAX_ENTRIES': 1000
}
}
}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Europe/Paris'
USE_I18N = False
# USE_L10N = True
USE_TZ = True
USE_THOUSAND_SEPARATOR = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
# For deployment
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
# For the Debugging extension
# management_IPS = [
# '127.0.0.1',
# ]
# Redirect to home URL after login (Default redirects to /accounts/profile/)
LOGIN_REDIRECT_URL = '/logged/'
LOGIN_REDIRECT_URL_APPLICANT = '/applicant/'
CRISPY_TEMPLATE_PACK = 'bootstrap4'
# Makes message tags compatible with Bootstrap4 alert messages
MESSAGE_TAGS = {
messages.DEBUG: 'alert-info',
messages.INFO: 'alert-info',
messages.SUCCESS: 'alert-success',
messages.WARNING: 'alert-warning',
messages.ERROR: 'alert-danger',
}
mimetypes.init()
LOGIN_CONTACT = 'SPI'
AWS_DEFAULT_ACL = 'private'
AWS_ACCESS_KEY_ID = os.environ['OBJECT_STORAGE_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['OBJECT_STORAGE_SECRET_ACCESS_KEY']
AWS_LOCATION = os.environ['OBJECT_STORAGE_PREFIX_LOCATION']
if 'OBJECT_STORAGE_ENDPOINT_URL' in os.environ:
AWS_S3_ENDPOINT_URL = os.environ['OBJECT_STORAGE_ENDPOINT_URL']
if 'OBJECT_STORAGE_BUCKET_NAME' in os.environ:
AWS_STORAGE_BUCKET_NAME = os.environ['OBJECT_STORAGE_BUCKET_NAME']
if 'OBJECT_STORAGE_REGION_NAME' in os.environ:
AWS_S3_REGION_NAME = os.environ['OBJECT_STORAGE_REGION_NAME']
if 'OBJECT_STORAGE_ADDRESSING_STYLE' in os.environ:
AWS_S3_ADDRESSING_STYLE = os.environ['OBJECT_STORAGE_ADDRESSING_STYLE']
DATE_FORMAT = 'd F Y'
DATETIME_FORMAT = 'd F Y H:i'
SHORT_DATE_FORMAT = 'd-m-Y'
SHORT_DATETIME_FORMAT = 'd-m-Y H:i'
AWS_S3_FILE_OVERWRITE = False
SECRET_KEY = os.environ['SECRET_KEY']
# The usual Django /admin will appear in /$ADMIN_URL_PATH
ADMIN_URL = os.environ['ADMIN_URL_PATH']
ALLOWED_HOSTS = []
i = 1
while f'ALLOWED_HOST_{i}' in os.environ:
ALLOWED_HOSTS.append(os.environ[f'ALLOWED_HOST_{i}'])
i += 1
ADMINS = []
i = 1
while f'ADMIN_{i}' in os.environ:
name_email = os.environ[f'ADMIN_{i}']
ADMINS.append(name_email.split(','))
i += 1
DEFAULT_FROM_EMAIL = SERVER_EMAIL = os.environ['FROM_EMAIL']
EMAIL_HOST = os.environ['EMAIL_HOST']
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_SUBJECT_PREFIX = os.environ['EMAIL_SUBJECT_PREFIX']
EMAIL_USE_TLS = True
# This is part of django-axes: lock out users temporary if login fails
# See https://django-axes.readthedocs.io/en/latest/4_configuration.html
AXES_ENABLED = 1
AXES_FAILURE_LIMIT = 10
# Next option would lock out the IP. Not doing it: from the office/NAT a user would be able to lock out all the users
# AXES_LOCK_OUT_AT_FAILURE = False
AXES_COOLOFF_TIME = datetime.timedelta(minutes=5)
AXES_ONLY_USER_FAILURES = True
AXES_LOCKOUT_TEMPLATE = 'registration/user-locked-out-out.tmpl'
DEBUG = os.environ['DEBUG'] == '1'
SECURE_SSL_REDIRECT = os.environ['SECURE_SSL_REDIRECT'] == '1'
SECURE_REFERRER_POLICY = 'same-origin'
if SECURE_SSL_REDIRECT:
SECURE_HSTS_PRELOAD = True
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_SECONDS = 3600
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
# Project Application specific settings
# These settings are specific by the Project Application code. They are not Django settings
HTTP_AUTH_INCOMING_LINKS = os.getenv('HTTP_AUTH_INCOMING_LINKS', '')
NAVBAR_BACKGROUND_COLOR = os.getenv('NAVBAR_BACKGROUND_COLOR', 'bg-primary')
# This category was used during the importer of Projects that were created before the Project Application existed
# These projects were managed via a Spreadsheet and imported here. Some information (comments, attachments)
# were assigned to DATA_IMPORT_CATEGORY_NAME but users of the application cannot select this category for their
# comments and attachments
DATA_IMPORT_CATEGORY_NAME = 'Data Import'
GOAT_COUNTER_CODE = os.getenv('GOAT_COUNTER_CODE', None)
REVIEWER_GROUP_NAME = 'reviewer'
MANAGEMENT_GROUP_NAME = 'management'
APPLICANT_GROUP_NAME = 'applicant'
REVIEWER_CAN_ACCESS_VIEW_NAMES = ['logged-proposal-list',
'logged-proposal-detail',
'logged-export-proposals-csv-summary-all',
'logged-export-proposals-csv-summary-call',
'logged-export-proposals-zip-all',
'logged-homepage']
APPLICANT_CAN_ACCESS_VIEW_NAMES = ['call-list',
'proposal-add',
'proposal-update',
'proposal-detail',
'proposal-detail-pdf',
'proposal-detail-zip',
'proposal-thank-you',
'proposal-cannot-modify',
'proposal-question-answer-file']
LOGGED_OUT_USERNAME = 'loggedout'
PROPOSAL_STATUS_DRAFT = 'Draft'
PROPOSAL_STATUS_SUBMITTED = 'Submitted'
LAY_SUMMARY_ORIGINAL = 'Original'
API_SECRET_KEY = os.getenv('API_SECRET_KEY')
SPI_MEDIA_GALLERY_IMPORT_CALLBACK = os.getenv('SPI_MEDIA_GALLERY_IMPORT_CALLBACK', None)
# To generate the PDF of a Proposal (for example) this application connects to itself. At a times it might
# be behind a proxy: it does the full route and might need to authenticate
SELF_HTTP_USERNAME = os.getenv('SELF_HTTP_USERNAME', None)
SELF_HTTP_PASSWORD = os.getenv('SELF_HTTP_PASSWORD', None)
# This part is created on creating a call
CALL_DEFAULT_PART_QUESTIONS_ANSWERS = 'Proposed {{ activity }} description'
DOCUMENTATION_URL = os.getenv('DOCUMENTATION_URL', None)
CKEDITOR_UPLOAD_PATH = 'upload/'
CKEDITOR_RESTRICT_BY_USER = True
MEDIA_URL = f'{AWS_S3_ENDPOINT_URL}/{AWS_STORAGE_BUCKET_NAME}/'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'Custom',
'toolbar_Custom': [
['Bold', 'Italic', 'Underline'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter',
'JustifyRight', 'JustifyBlock'],
['RemoveFormat', 'Source'],
['Image'],
['Link', 'Unlink', 'Anchor']
],
'removeDialogTabs': 'image:advanced;image:Link;',
}
}
DATA_UPLOAD_MAX_NUMBER_FIELDS = 2000
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,103 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py | from django.core.management import BaseCommand
from ...models import Keyword
class Command(BaseCommand):
def handle(self, *args, **options):
delete_keyword()
def delete_keyword():
"""Check if a keyword, created by an external user, has been used in a proposal or project. If it is not used, then delete it from the database."""
# get keywords created by an external user
keywords_external = Keyword.objects.filter(uid__source__source='External User')
# get external keywords not used by a project or proposal.
keywords_external_unused = keywords_external.filter(proposal__id=None).filter(project__id=None).delete()
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,104 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0045_milestone_category_to_category.py | # Generated by Django 3.0.5 on 2020-05-19 09:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0044_historicalmilestone_milestone_milestonecategory'),
]
operations = [
migrations.RenameField(
model_name='historicalmilestone',
old_name='milestone_category',
new_name='category',
),
migrations.RenameField(
model_name='milestone',
old_name='milestone_category',
new_name='category',
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,105 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0134_auto_add_role_description.py | # Generated by Django 3.0.8 on 2020-08-14 13:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0133_auto_add_head_of_research_unit_in_proposal'),
]
operations = [
migrations.CreateModel(
name='RoleDescription',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('description', models.TextField(help_text='Description of the role')),
('competences', models.TextField(help_text='Description of the key competences')),
('role', models.ForeignKey(help_text='Role of the partner', on_delete=django.db.models.deletion.PROTECT, to='project_core.Role')),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='historicalproposal',
name='applicant_role_description',
field=models.ForeignKey(blank=True, db_constraint=False, help_text='Main applicant role', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='project_core.RoleDescription'),
),
migrations.AddField(
model_name='proposal',
name='applicant_role_description',
field=models.ForeignKey(blank=True, help_text='Main applicant role', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.RoleDescription'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,106 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0082_adds_external_project.py | # Generated by Django 2.2.6 on 2019-11-27 10:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0081_field_help_text_changes'),
]
operations = [
migrations.CreateModel(
name='ExternalProject',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('title', models.CharField(help_text='Title of the project', max_length=500)),
('created_by', models.ForeignKey(blank=True, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_externalproject_created_by_related', to=settings.AUTH_USER_MODEL)),
('leader', models.ForeignKey(blank=True, help_text='Leader of this project', null=True, on_delete=django.db.models.deletion.PROTECT, to='project_core.PersonPosition')),
('modified_by', models.ForeignKey(blank=True, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_externalproject_modified_by_related', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,107 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0062_add_file_web.py | # Generated by Django 3.2.12 on 2022-03-25 09:15
from django.db import migrations, models
import grant_management.models
import storages.backends.s3boto3
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0061_key_and_primary_image'),
]
operations = [
migrations.AddField(
model_name='medium',
name='file_web',
field=models.FileField(null=True, storage=storages.backends.s3boto3.S3Boto3Storage(), upload_to=grant_management.models.medium_file_rename),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,108 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0062_geographicalareauid_model.py | # Generated by Django 2.2.6 on 2019-10-23 06:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0061_createmodify_geographicalarea'),
]
operations = [
migrations.CreateModel(
name='GeographicalAreaUid',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('uid', models.CharField(help_text='Unique identifier', max_length=150, null=True)),
('created_by', models.ForeignKey(blank=True, help_text='User by which the entry was created', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_geographicalareauid_created_by_related', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, help_text='User by which the entry was modified', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='project_core_geographicalareauid_modified_by_related', to=settings.AUTH_USER_MODEL)),
('source', models.ForeignKey(help_text='Source of the UID', on_delete=django.db.models.deletion.PROTECT, to='project_core.Source')),
],
options={
'abstract': False,
'unique_together': {('uid', 'source')},
},
),
migrations.AddField(
model_name='geographicalarea',
name='uid',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='project_core.GeographicalAreaUid'),
preserve_default=False,
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,109 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/migrations/0003_rename_reviewer_field_to_user.py | # Generated by Django 3.0.3 on 2020-02-17 11:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0002_reviewer_many_to_many_call'),
]
operations = [
migrations.RenameField(
model_name='reviewer',
old_name='reviewer',
new_name='user',
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,110 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0001_initial.py | # Generated by Django 2.2.4 on 2019-08-16 13:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Date',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('notable_date', models.CharField(help_text='Description of notable date', max_length=128)),
('date', models.DateTimeField(help_text='Date and time of notable date', max_length=64)),
],
),
migrations.CreateModel(
name='Call',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('long_name', models.CharField(help_text='Full name of the call', max_length=128)),
('short_name', models.CharField(blank=True, help_text='Short name or acronym of the call', max_length=64, null=True)),
('description', models.TextField(help_text='Description of the call that can be used to distinguish it from others')),
('dates', models.ManyToManyField(help_text='Notable date related to the call', to='project_core.Date')),
],
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,111 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0106_project_status.py | # Generated by Django 3.0.3 on 2020-02-19 14:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_core', '0105_project_projectpartner'),
]
operations = [
migrations.AddField(
model_name='project',
name='status',
field=models.CharField(choices=[('Ongoing', 'Ongoing'), ('Completed', 'Completed')], default='ONGOING', help_text='Status of a project', max_length=30),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,112 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0018_remove_laysummary_sent_date.py | # Generated by Django 3.0.5 on 2020-04-29 08:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0017_renames_reception_to_received'),
]
operations = [
migrations.RemoveField(
model_name='laysummary',
name='sent_date',
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,113 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/admin.py | from django.contrib import admin
from django.utils.html import escape
from django.utils.safestring import mark_safe
from simple_history.admin import SimpleHistoryAdmin
import project_core.models
proposal_search_fields = ('proposal__title',
'proposal__applicant__academic_title__title', 'proposal__applicant__person__first_name',
'proposal__applicant__person__surname',)
# Not an admin but to add history fields on admin
# To use it just add:
# history_list_display = ('history_field_changes',)
# And inherit of SimpleHistoryAdminFieldChanges
class SimpleHistoryAdminFieldChanges:
def history_field_changes(self, obj):
description_changes = ''
if obj.prev_record:
delta = obj.diff_against(obj.prev_record)
for field in delta.changed_fields:
previous_value = escape(getattr(delta.old_record, field))
new_value = escape(getattr(delta.new_record, field))
description_changes += f'Field: {field} Prev: {previous_value} Current: {new_value}<br>'
return mark_safe(description_changes)
class StepTypeAdmin(admin.ModelAdmin):
search_fields = ('name', 'description', )
list_display = ('name', 'description',)
ordering = ('name', 'description',)
class StepAdmin(admin.ModelAdmin):
search_fields = ('call__long_name', 'step_type__name', )
list_display = ('call', 'step_type', 'date', 'created_on', 'modified_on',)
ordering = ('call', 'step_type', 'date', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class BudgetCategoryAdmin(admin.ModelAdmin):
search_fields = ('name', 'description', 'order',)
list_display = ('name', 'description', 'order',)
ordering = ('name', 'order',)
class FundingInstrumentAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('long_name', 'short_name__name', 'description',)
list_display = ('long_name', 'short_name', 'description', 'created_on', 'modified_on',)
ordering = ('long_name', 'short_name', 'description', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
class CallAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('long_name', 'short_name', 'budget_maximum',)
list_display = (
'long_name', 'short_name', 'call_open_date', 'submission_deadline',
# 'budget_categories_list',
'budget_maximum', 'other_funding_question',
'proposal_partner_question', 'overarching_project_question', 'scientific_clusters_question',
'keywords_in_general_information_question', 'overall_budget_question',
'created_on', 'modified_on',)
ordering = ('long_name', 'short_name', 'call_open_date', 'submission_deadline', 'budget_maximum',
'created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
readonly_fields = ('created_on', 'modified_on',)
class BudgetCategoryCallAdmin(admin.ModelAdmin):
search_fields = ('call__long_name', 'budget_category__name', 'order',)
list_display = ('call', 'budget_category', 'enabled', 'order',)
ordering = ('call', 'budget_category', 'order',)
class KeywordAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'uid', 'created_on', 'modified_on',)
ordering = ('name', 'description', 'uid', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
search_fields = ('name', 'description',)
raw_id_fields = ('uid',)
class KeywordUidAdmin(admin.ModelAdmin):
search_fields = ('uid', 'source__source',)
list_display = ('uid', 'source', 'created_on', 'modified_on',)
ordering = ('uid', 'source', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class ProposalStatusAdmin(admin.ModelAdmin):
search_fields = ('name', 'description',)
list_display = ('name', 'description',)
ordering = ('description',)
class PersonTitleAdmin(admin.ModelAdmin):
search_fields = ('title',)
list_display = ('title',)
ordering = ('title',)
class CountryUidAdmin(admin.ModelAdmin):
search_fields = ('uid', 'source__source',)
list_display = ('uid', 'source', 'created_on', 'modified_on',)
ordering = ('uid', 'source', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class CountryAdmin(admin.ModelAdmin):
search_fields = ('name', 'uid__uid', 'uid__source__source',)
list_display = ('name', 'uid', 'created_on', 'modified_on',)
ordering = ('name', 'uid', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class OrganisationUidAdmin(admin.ModelAdmin):
search_fields = ('uid', 'source__source',)
list_display = ('uid', 'source', 'created_on', 'modified_on',)
ordering = ('uid', 'source', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class OrganisationAdmin(admin.ModelAdmin):
list_display = (
'long_name', 'short_name', 'display_name', 'street', 'city', 'postal_code', 'country', 'uid', 'created_on',
'modified_on',)
ordering = ('long_name', 'short_name', 'display_name', 'city', 'country', 'uid', 'created_on',
'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
search_fields = ('long_name', 'short_name', 'display_name', 'street', 'city', 'postal_code', 'country__name', 'uid__uid',)
class OrganisationNameAdmin(admin.ModelAdmin):
search_fields = ('name', 'organisation__long_name',)
list_display = ('name', 'organisation', 'created_on', 'modified_on',)
ordering = ('name',)
readonly_fields = ('created_on', 'modified_on',)
class SourceAdmin(admin.ModelAdmin):
search_fields = ('source', )
list_display = ('source', 'created_on', 'modified_on',)
ordering = ('source', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class GenderAdmin(admin.ModelAdmin):
search_fields = ('name',)
list_display = ('name', 'created_on', 'modified_on',)
ordering = ('name', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class PhysicalPersonAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
list_display = (
'first_name', 'surname', 'orcid', 'gender', 'phd_date', 'created_on', 'modified_on',)
ordering = ('first_name', 'surname', 'orcid', 'gender', 'phd_date', 'created_on',
'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
search_fields = ('first_name', 'surname', 'orcid', 'gender__name',)
class PersonUidAdmin(admin.ModelAdmin):
list_display = ('person', 'uid', 'source',)
ordering = ('person', 'uid', 'source',)
class PersonPositionAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('person__first_name', 'person__surname', 'academic_title__title', 'career_stage__name',)
list_display = (
'person', 'academic_title', 'career_stage', 'organisations_list', 'group', 'privacy_policy',
'contact_newsletter', 'created_on', 'modified_on',)
ordering = ('person', 'academic_title', 'career_stage', 'group', 'privacy_policy', 'contact_newsletter',
'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
def organisations_list(self, obj):
organisation_names = obj.organisation_names.all()
return ', '.join([str(organisation_name.name) for organisation_name in organisation_names])
class ContactAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('person_position__person__first_name', 'person_position__person__surname', 'entry', 'method',)
list_display = ('person_position', 'method', 'entry', 'created_on', 'modified_on',)
ordering = ('person_position', 'method', 'entry', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
class GeographicalAreaUidAdmin(admin.ModelAdmin):
search_fields = ('uid', 'source__source',)
list_display = ('uid', 'source', 'created_on', 'modified_on',)
ordering = ('uid', 'source', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class GeographicalAreaAdmin(admin.ModelAdmin):
search_fields = ('name', 'definition', 'uid__uid', 'uid__source__source',)
list_display = ('name', 'definition', 'uid', 'created_on', 'modified_on',)
ordering = ('name', 'uid', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class ProposalAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = (
'title', 'uuid', 'location', 'duration_months', 'applicant__person__first_name', 'applicant__person__surname')
list_display = ('title', 'uuid', 'keywords_list', 'geographical_area_list', 'location', 'start_date',
'end_date', 'duration_months', 'applicant', 'proposal_status', 'eligibility', 'eligibility_comment',
'call', 'created_on', 'modified_on',
'draft_saved_mail_sent', 'submitted_mail_sent',)
ordering = ('title', 'uuid', 'start_date', 'end_date', 'duration_months', 'applicant',
'proposal_status', 'eligibility', 'eligibility_comment', 'call', 'created_on',
'modified_on', 'draft_saved_mail_sent', 'submitted_mail_sent',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
def keywords_list(self, obj):
keywords = obj.keywords.all()
return ", ".join([keyword.name for keyword in keywords])
def geographical_area_list(self, obj):
geographical_areas = obj.geographical_areas.all()
return ", ".join([geographical_area.name for geographical_area in geographical_areas])
def qas_list(self, obj):
qas = obj.proposalqatext_set.all()
result = ''
for qa in qas:
qa: project_core.models.ProposalQAText
result += 'Q: {}, A: {}'.format(qa.call_question.question_text, qa.answer)
return result
class ProposedBudgetItemAdmin(admin.ModelAdmin):
search_fields = ('category__name', 'details', 'amount',) + proposal_search_fields
list_display = ('category', 'details', 'amount', 'proposal',)
ordering = ('details', 'amount', 'proposal',)
class FundingStatusAdmin(admin.ModelAdmin):
search_fields = ('status', 'description',)
list_display = ('status', 'description',)
ordering = ('status',)
class ProposalFundingItemAdmin(admin.ModelAdmin):
search_fields = proposal_search_fields + ('funding_status__status', 'amount',)
list_display = ('proposal', 'organisation_name', 'funding_status', 'amount',)
ordering = ('proposal', 'organisation_name', 'funding_status', 'amount',)
class CallQuestionAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('call_part__title', 'question_text', 'question_description', 'answer_max_length',)
list_display = (
'call_part', 'question_text', 'question_description', 'answer_type', 'answer_max_length', 'order',
'created_on', 'modified_on',)
ordering = ('call_part', 'question_text', 'answer_type', 'answer_max_length', 'order', 'created_on',
'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
class TemplateQuestionAdmin(SimpleHistoryAdmin, SimpleHistoryAdminFieldChanges):
search_fields = ('question_text', 'question_description', 'answer_type', 'answer_max_length', )
list_display = (
'question_text', 'question_description', 'answer_type', 'answer_max_length', 'created_on',
'modified_on',)
ordering = ('question_text', 'answer_type', 'answer_max_length', 'created_on',
'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
history_list_display = ('history_field_changes',)
class ProposalQATextAdmin(admin.ModelAdmin):
search_fields = proposal_search_fields + ('call_question__question_text', 'answer',)
list_display = ('proposal', 'call_question', 'answer', 'created_on', 'modified_on',)
ordering = ('proposal', 'call_question', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class CareerStageAdmin(admin.ModelAdmin):
search_fields = ('name', 'description', 'list_order',)
list_display = ('name', 'description', 'list_order',)
ordering = ('name', 'list_order',)
class CallCareerStageAdmin(admin.ModelAdmin):
search_fields = ('call__long_name', 'career_stage__title')
list_display = ('call', 'career_stage', 'enabled',)
ordering = ('call', 'career_stage', 'enabled',)
class RoleAdmin(admin.ModelAdmin):
search_fields = ('name', 'description', 'type',)
list_display = ('name', 'description', 'type',)
ordering = ('name', 'type',)
class ProposalPartnerAdmin(admin.ModelAdmin):
search_fields = proposal_search_fields + (
'person__person__first_name', 'person__person__surname', 'role__name', 'role_description', 'competences',)
list_display = ('proposal', 'person', 'role', 'role_description', 'competences',)
ordering = ('proposal', 'person', 'role',)
class ProposalQAFileAdmin(admin.ModelAdmin):
search_fields = proposal_search_fields + ('call_question__question_text', 'file', 'md5',)
list_display = (
'proposal', 'call_question', 'file', 'md5', 'created_on', 'modified_on',)
ordering = ('proposal', 'call_question', 'file', 'md5', 'created_on', 'modified_on',)
readonly_fields = ('created_on', 'modified_on',)
class ProjectAdmin(admin.ModelAdmin):
search_fields = ('title', 'key', 'uuid', 'location', 'principal_investigator__person__first_name',
'principal_investigator__person__surname',)
list_display = ('title', 'key', 'uuid', 'keywords_list', 'geographical_area_list', 'location', 'start_date',
'end_date', 'principal_investigator', 'call', 'proposal', 'overarching_project',
'allocated_budget', 'status', 'abortion_reason', 'created_on', 'modified_on',)
ordering = ('title', 'key', 'uuid', 'location', 'start_date', 'end_date', 'principal_investigator',
'call', 'proposal', 'allocated_budget', 'status', 'abortion_reason',)
def keywords_list(self, obj):
keywords = obj.keywords.all()
return ", ".join([keyword.name for keyword in keywords])
def geographical_area_list(self, obj):
geographical_areas = obj.geographical_areas.all()
return ", ".join([geographical_area.name for geographical_area in geographical_areas])
class ProjectPartnerAdmin(admin.ModelAdmin):
search_fields = project_core.models.Project.search_fields + (
'person__person__first_name', 'person__person__surname',
'person__academic_title__title',)
list_display = ('project', 'person', 'role', 'role_description', 'competences',)
ordering = ('project', 'person', 'role',)
class FinancialKeyAdmin(admin.ModelAdmin):
search_fields = ('name', 'account_number', 'description',)
list_display = ('name', 'account_number', 'description', 'funding_instrument', 'created_on', 'created_by',)
ordering = ('name', 'description', 'created_on',)
class PostalAddressAdmin(admin.ModelAdmin):
search_fields = ('address', 'city', 'postcode', 'country__name',)
list_display = ('address', 'city', 'postcode', 'country',)
ordering = ('address', 'city', 'postcode', 'country__name',)
class RoleDescriptionAdmin(admin.ModelAdmin):
search_fields = ('role__name', 'role__description', 'description', 'competences',)
list_display = ('role', 'description', 'competences',)
ordering = ('role', 'description', 'competences',)
class CallPartAdmin(admin.ModelAdmin):
search_fields = ('call__long_name', 'title', 'introductory_text',)
list_display = ('call', 'title', 'introductory_text')
class CallPartFileAdmin(admin.ModelAdmin):
search_fields = ('call_part__title', 'name', 'description', 'file',)
list_display = ('call_part', 'name', 'description', 'file',)
admin.site.register(project_core.models.StepType, StepTypeAdmin)
admin.site.register(project_core.models.Step, StepAdmin)
admin.site.register(project_core.models.BudgetCategory, BudgetCategoryAdmin)
admin.site.register(project_core.models.FundingInstrument, FundingInstrumentAdmin)
admin.site.register(project_core.models.Call, CallAdmin)
admin.site.register(project_core.models.BudgetCategoryCall, BudgetCategoryCallAdmin)
admin.site.register(project_core.models.Keyword, KeywordAdmin)
admin.site.register(project_core.models.KeywordUid, KeywordUidAdmin)
admin.site.register(project_core.models.ProposalStatus, ProposalStatusAdmin)
admin.site.register(project_core.models.PersonTitle, PersonTitleAdmin)
admin.site.register(project_core.models.CountryUid, CountryUidAdmin)
admin.site.register(project_core.models.Country, CountryAdmin)
admin.site.register(project_core.models.OrganisationUid, OrganisationUidAdmin)
admin.site.register(project_core.models.Organisation, OrganisationAdmin)
admin.site.register(project_core.models.OrganisationName, OrganisationNameAdmin)
admin.site.register(project_core.models.Source, SourceAdmin)
admin.site.register(project_core.models.PersonUid, PersonUidAdmin)
admin.site.register(project_core.models.Gender, GenderAdmin)
admin.site.register(project_core.models.PhysicalPerson, PhysicalPersonAdmin)
admin.site.register(project_core.models.PersonPosition, PersonPositionAdmin)
admin.site.register(project_core.models.Contact, ContactAdmin)
admin.site.register(project_core.models.GeographicalAreaUid, GeographicalAreaUidAdmin)
admin.site.register(project_core.models.GeographicalArea, GeographicalAreaAdmin)
admin.site.register(project_core.models.Proposal, ProposalAdmin)
admin.site.register(project_core.models.ProposedBudgetItem, ProposedBudgetItemAdmin)
admin.site.register(project_core.models.FundingStatus, FundingStatusAdmin)
admin.site.register(project_core.models.ProposalFundingItem, ProposalFundingItemAdmin)
admin.site.register(project_core.models.CallQuestion, CallQuestionAdmin)
admin.site.register(project_core.models.TemplateQuestion, TemplateQuestionAdmin)
admin.site.register(project_core.models.ProposalQAText, ProposalQATextAdmin)
admin.site.register(project_core.models.CareerStage, CareerStageAdmin)
admin.site.register(project_core.models.CallCareerStage, CallCareerStageAdmin)
admin.site.register(project_core.models.Role, RoleAdmin)
admin.site.register(project_core.models.ProposalPartner, ProposalPartnerAdmin)
admin.site.register(project_core.models.ProposalQAFile, ProposalQAFileAdmin)
admin.site.register(project_core.models.Project, ProjectAdmin)
admin.site.register(project_core.models.ProjectPartner, ProjectPartnerAdmin)
admin.site.register(project_core.models.FinancialKey, FinancialKeyAdmin)
admin.site.register(project_core.models.PostalAddress, PostalAddressAdmin)
admin.site.register(project_core.models.RoleDescription, RoleDescriptionAdmin)
admin.site.register(project_core.models.CallPart, CallPartAdmin)
admin.site.register(project_core.models.CallPartFile, CallPartFileAdmin)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,114 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/views/logged/call.py | from django.contrib import messages
from django.db import transaction
from django.shortcuts import render, redirect
from django.urls import reverse
from django.views.generic import TemplateView, ListView
from ProjectApplication import settings
from comments import utils
from comments.utils import process_comment_attachment, comments_attachments_forms
from evaluation.models import CallEvaluation
from project_core.forms.call import CallForm
from project_core.models import Call, Proposal, FundingInstrument, BudgetCategoryCall, BudgetCategory, CallCareerStage,\
CallPart, CallQuestion, CallPartFile
from variable_templates.forms.template_variables import TemplateVariableItemFormSet
from variable_templates.utils import copy_template_variables_from_funding_instrument_to_call, \
get_template_variables_for_call, get_template_value_for_call
from .funding_instrument import TEMPLATE_VARIABLES_FORM_NAME
from ..common.proposal import AbstractProposalDetailView
from ...widgets import CheckboxSelectMultipleSortable
import datetime
CALL_QUESTION_FORM_NAME = 'call_question_form'
CALL_FORM_NAME = 'call_form'
class CallList(TemplateView):
template_name = 'logged/call-list.tmpl'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'view_button': True,
'edit_button': True,
'proposal_call_list_button': True,
'proposal_evaluation_list_button': False,
'evaluation_spreadsheet_button': False,
'evaluation_summary_or_validation_button': False})
context.update({'open_calls': Call.open_calls(),
'closed_calls': Call.closed_calls(),
'future_calls': Call.future_calls()})
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Calls'}]
context['active_tab'] = self.request.GET.get('tab', 'open')
return context
class AbstractCallView(TemplateView):
def prepare_context(self, request, *args, **kwargs):
context = super().get_context_data(**kwargs)
call = Call.objects.get(id=kwargs['pk'])
context['call'] = call
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['template_variables'] = get_template_variables_for_call(call)
CheckboxSelectMultipleSortable.add_missing_related_objects(BudgetCategoryCall, call,
'call', BudgetCategory, 'budget_category')
budget_categories_status = []
for budget_category_call in BudgetCategoryCall.objects.filter(call=call).order_by('order'):
in_call = budget_category_call.enabled
budget_categories_status.append({'in_call': in_call,
'name': budget_category_call.budget_category.name})
context['budget_categories_status'] = budget_categories_status
context.update(comments_attachments_forms('logged-call-comment-add', call))
if call.evaluation_is_closed():
url = self.request.build_absolute_uri(reverse('lay-summaries-for_website', kwargs={'call': call.id}))
if settings.HTTP_AUTH_INCOMING_LINKS:
username_password_tag = f' userpwd="{settings.HTTP_AUTH_INCOMING_LINKS}"'
else:
username_password_tag = ''
context['public_lay_summaries_for_website_url'] = f'[remote_content url="{url}"{username_password_tag}]'
context['parts'] = call.parts()
context['career_stages_status'] = []
for call_career_stage in CallCareerStage.objects.filter(call=call).order_by('career_stage__list_order'):
context['career_stages_status'].append({'name': call_career_stage.career_stage.name,
'enabled': call_career_stage.enabled})
return context
class CallDetailView(AbstractCallView):
def get(self, request, *args, **kwargs):
context = self.prepare_context(request, *args, **kwargs)
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-call-list')},
{'name': f'Details ({context["call"].short_name})'}]
return render(request, 'logged/call-detail.tmpl', context)
class CallCommentAdd(AbstractCallView):
def post(self, request, *args, **kwargs):
context = self.prepare_context(request, *args, **kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
call = Call.objects.get(id=kwargs['pk'])
result = process_comment_attachment(request, context, 'logged-call-detail',
'logged-call-comment-add',
'logged/call-detail.tmpl',
call)
return result
class ProposalList(ListView):
template_name = 'logged/_call_list-proposals.tmpl'
model = Proposal
context_object_name = 'proposals'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
call = Call.objects.get(id=self.kwargs['call_id'])
context['call'] = call
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-calls')},
{'name': f'List of proposals ({call.little_name()})'}]
return context
def get_queryset(self):
call = Call.objects.get(id=self.kwargs['call_id'])
return Proposal.objects.filter(call=call)
class ProposalDetail(AbstractProposalDetailView):
def get(self, request, *args, **kwargs):
context = self.prepare_context(request, *args, **kwargs)
proposal = Proposal.objects.get(id=kwargs['pk'])
context['external_url'] = self.request.build_absolute_uri(
reverse('proposal-update', kwargs={'uuid': proposal.uuid}))
context.update(utils.comments_attachments_forms('logged-call-proposal-detail', proposal))
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'
})
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-call-list')},
{'name': f'List of proposals ({proposal.call.little_name()})',
'url': reverse('logged-call-list-proposals', kwargs={'call_id': proposal.call.id})},
{'name': 'Proposal'}]
context['activity'] = get_template_value_for_call('activity', proposal.call)
return render(request, 'logged/proposal-detail.tmpl', context)
def post(self, request, *args, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'active_section': 'calls',
'active_subsection': 'call-list',
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
proposal = Proposal.objects.get(id=kwargs['pk'])
result = process_comment_attachment(request, context, 'logged-call-proposal-detail',
'logged-call-comment-add',
'logged/proposal-detail.tmpl',
proposal)
return result
def get_funding_instruments_data():
funding_instruments_data = {}
for funding_instrument in FundingInstrument.objects.all():
funding_instruments_data[funding_instrument.id] = {'long_name': funding_instrument.long_name,
'short_name': funding_instrument.short_name.name
}
return funding_instruments_data
class CallView(TemplateView):
template_name = 'logged/call-form.tmpl'
@staticmethod
def _cancel_url(kwargs):
if 'pk' in kwargs:
return reverse('logged-call-detail', kwargs={'pk': kwargs['pk']})
else:
return reverse('logged-call-list')
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['cancel_url'] = CallView._cancel_url(kwargs)
if 'pk' in kwargs:
call_id = kwargs['pk']
call = Call.objects.get(id=call_id)
context['call'] = call
context[CALL_FORM_NAME] = CallForm(instance=call, prefix=CALL_FORM_NAME)
context[TEMPLATE_VARIABLES_FORM_NAME] = TemplateVariableItemFormSet(call=call,
prefix=TEMPLATE_VARIABLES_FORM_NAME)
context['call_action_url'] = reverse('logged-call-update', kwargs={'pk': call_id})
context['call_action'] = 'Edit'
context['parts'] = call.parts()
context['active_subsection'] = 'call-list'
breadcrumb_page = f'{context["call_action"]} ({call.little_name()})'
else:
context[CALL_FORM_NAME] = CallForm(prefix=CALL_FORM_NAME)
context[TEMPLATE_VARIABLES_FORM_NAME] = TemplateVariableItemFormSet(prefix=TEMPLATE_VARIABLES_FORM_NAME)
context['call_action_url'] = reverse('logged-call-add')
context['call_action'] = 'Create'
context['active_subsection'] = 'call-add'
breadcrumb_page = 'Create'
context['funding_instruments_data'] = get_funding_instruments_data()
context['active_section'] = 'calls'
context['sidebar_template'] = 'logged/_sidebar-calls.tmpl'
context['breadcrumb'] = [{'name': 'Calls', 'url': reverse('logged-calls')},
{'name': breadcrumb_page}]
return context
@transaction.atomic
def post(self, request, *args, **kwargs):
context = super().get_context_data(**kwargs)
context['cancel_url'] = CallView._cancel_url(kwargs)
new_call = False
template_variables_form = None # avoids warning referenced without initialization
if 'pk' in kwargs:
call = Call.objects.get(id=kwargs['pk'])
call_form = CallForm(request.POST, instance=call, prefix=CALL_FORM_NAME)
template_variables_form = TemplateVariableItemFormSet(request.POST, call=call,
prefix=TEMPLATE_VARIABLES_FORM_NAME)
context['call_action_url'] = reverse('logged-call-update', kwargs={'pk': call.id})
call_action = 'Edit'
action = 'updated'
active_subsection = 'call-list'
to_validate = [call_form,
# call_question_form,
template_variables_form]
else:
# creates a call
new_call = True
call_form = CallForm(request.POST, prefix=CALL_FORM_NAME)
context['call_action_url'] = reverse('logged-call-add')
context['call_action'] = 'Create'
call_action = 'Create'
action = 'created'
active_subsection = 'call-add'
to_validate = [call_form,
]
all_valid = True
for form in to_validate:
valid_form = form.is_valid()
all_valid = all_valid and valid_form
if all_valid:
call = call_form.save()
if new_call:
copy_template_variables_from_funding_instrument_to_call(call)
else:
template_variables_form.save_into_call(call)
messages.success(request, 'Call has been saved')
return redirect(reverse('logged-call-detail', kwargs={'pk': call.id}) + '?action={}'.format(action))
context = super().get_context_data(**kwargs)
context['call_action'] = call_action
context[CALL_FORM_NAME] = call_form
context[TEMPLATE_VARIABLES_FORM_NAME] = template_variables_form
context.update({'active_section': 'calls',
'active_subsection': active_subsection,
'sidebar_template': 'logged/_sidebar-calls.tmpl'})
messages.error(request, 'Call not saved. Please correct the errors in the form and try again.')
return render(request, 'logged/call-form.tmpl', context)
class CallCopy(TemplateView):
def get(self, request, *args, **kwargs):
if 'pk' in kwargs:
date_time = datetime.datetime.now()
formatedDate = date_time.strftime("%Y-%m-%d %H:%M:%S")
call = Call.objects.get(id=kwargs['pk'])
call.pk = None
call_long_name = call.long_name.rsplit(' ', 1)[0]
call.long_name = call_long_name + ' ' + str(formatedDate)
call.save()
saved_call_id = call.pk
call_parts = CallPart.objects.filter(call_id=kwargs['pk'])
for call_part in call_parts:
call_files = CallPartFile.objects.filter(call_part_id=call_part.pk)
call_quetions = CallQuestion.objects.filter(call_part_id=call_part.pk)
call_part.pk = None
call_part.call_id = saved_call_id
call_part.save()
for call_file in call_files:
call_file.pk = None
call_file.call_part_id = call_part.pk
call_file.save()
for call_quetion in call_quetions:
call_quetion.pk = None
call_quetion.call_part_id = call_part.pk
call_quetion.save()
return redirect(reverse('logged-call-update', kwargs={'pk': call.pk}))
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,115 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/evaluation/migrations/0012_adds_proposalevaluation.py | # Generated by Django 3.0.3 on 2020-03-06 12:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('evaluation', '0011_adds_decision_letter'),
]
operations = [
migrations.AddField(
model_name='historicalproposalevaluation',
name='decision_letter_date',
field=models.DateField(blank=True, null=True),
),
migrations.AddField(
model_name='proposalevaluation',
name='decision_letter_date',
field=models.DateField(blank=True, null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,116 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0042_improves_project_data_publications_social_media_types.py | # Generated by Django 3.0.5 on 2020-05-13 09:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
('grant_management', '0041_allows_media_to_not_be_related_blog_post'),
]
operations = [
migrations.CreateModel(
name='ProjectSocialNetwork',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('url', models.URLField(blank=True, help_text='Address of social media entry (e.g. https://twitter.com/SwissPolar)', null=True)),
('project', models.ForeignKey(help_text='Choose related project', on_delete=django.db.models.deletion.PROTECT, to='project_core.Project')),
],
options={
'abstract': False,
},
),
migrations.RenameField(
model_name='dataset',
old_name='date_published',
new_name='published_date',
),
migrations.RemoveField(
model_name='publication',
name='date_time_published',
),
migrations.AddField(
model_name='publication',
name='published_date',
field=models.DateField(blank=True, help_text='Date of the publication', null=True),
),
migrations.AlterField(
model_name='dataset',
name='doi',
field=models.CharField(blank=True, help_text='DOI reference for entry', max_length=100, null=True),
),
migrations.AlterField(
model_name='dataset',
name='title',
field=models.CharField(help_text='Dataset title', max_length=1000),
),
migrations.AlterField(
model_name='publication',
name='doi',
field=models.CharField(blank=True, help_text='DOI reference for entry', max_length=100, null=True),
),
migrations.AlterField(
model_name='publication',
name='reference',
field=models.CharField(blank=True, help_text='Journal reference for entry', max_length=1000, null=True),
),
migrations.AlterField(
model_name='publication',
name='title',
field=models.CharField(help_text='Publication title', max_length=1000),
),
migrations.AlterField(
model_name='socialnetwork',
name='name',
field=models.CharField(help_text='Please enter social network title (e.g. Twitter, Facebook, Instagram, Blog)', max_length=100),
),
migrations.DeleteModel(
name='ProjectSocialMedia',
),
migrations.AddField(
model_name='projectsocialnetwork',
name='social_network',
field=models.ForeignKey(help_text='Choose the related social network', on_delete=django.db.models.deletion.PROTECT, to='grant_management.SocialNetwork'),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,117 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/migrations/0119_financialkey.py | # Generated by Django 3.0.5 on 2020-05-20 10:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('project_core', '0118_calls_need_to_be_part_of_a_funding_instrument'),
]
operations = [
migrations.CreateModel(
name='FinancialKey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time at which the entry was created')),
('modified_on', models.DateTimeField(auto_now=True, help_text='Date and time at which the entry was modified', null=True)),
('name', models.CharField(help_text='Code used by finance (e.g. ECON, TRAVEL) or funding instrument', max_length=20)),
('description', models.CharField(help_text='Explanation of the code', max_length=200)),
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,118 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/project_core/templatetags/filesizeformat_safe.py | import botocore
from django import template
from django.template.defaultfilters import filesizeformat
register = template.Library()
@register.filter(name='filesizeformat_safe')
def filesizeformat_safe(filefield):
try:
size = filefield.size
except botocore.exceptions.ClientError:
return 'File not found'
return filesizeformat(size)
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,119 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/comments/forms/attachment.py | import logging
import botocore
from botocore.exceptions import EndpointConnectionError
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit
from django import forms
from ProjectApplication import settings
logger = logging.getLogger('comments')
class AttachmentForm(forms.Form):
FORM_NAME = 'attachment_form'
# Note that Comments are not editable, so initial is always empty, always a new comment
def __init__(self, *args, **kwargs):
form_action = kwargs.pop('form_action')
category_queryset = kwargs.pop('category_queryset').exclude(category__name=settings.DATA_IMPORT_CATEGORY_NAME)
super().__init__(*args, **kwargs)
self.fields['category'] = forms.ModelChoiceField(label='Category',
queryset=category_queryset,
help_text='Select category of comment')
self.fields['file'] = forms.FileField(label='Attachment', help_text='File to attach')
self.fields['text'] = forms.CharField(label='Text', max_length=10000,
help_text='Write a comment of the file (max length: 10000 characters)',
required=False,
widget=forms.Textarea(attrs={'rows': 4}))
self.helper = FormHelper(self)
self.helper.form_action = form_action
self.helper.add_input(Submit('attachment_form_submit', 'Save File', css_class='btn-primary'))
self.helper.layout = Layout(
Div(
Div('category', css_class='col-12'),
css_class='row'
),
Div(
Div('file', css_class='col-12'),
css_class='row'
),
Div(
Div('text', css_class='col-12'),
css_class='row'
)
)
def save(self, parent, user):
attachment = parent.attachment_object()()
attachment.set_parent(parent)
attachment.text = self.cleaned_data['text']
attachment.created_by = user
attachment.category = self.cleaned_data['category']
attachment.file = self.cleaned_data['file']
all_good = True
try:
attachment.save()
except EndpointConnectionError:
all_good = False
logger.warning(
f'NOTIFY: Saving attachment failed (parent {type(parent)}: {parent.id} User: {user}) -EndpointConnectionError')
except botocore.exceptions.ClientError:
all_good = False
logger.warning(
f'NOTIFY: Saving attachment failed (parent: {type(parent)} {parent.id} User: {user} -ClientError')
return all_good
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
55,120 | Swiss-Polar-Institute/project-application | refs/heads/master | /ProjectApplication/grant_management/migrations/0027_bblog_post_text.py | # Generated by Django 3.0.5 on 2020-05-01 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grant_management', '0026_laysummarytype_non_mandatory'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='text',
field=models.TextField(blank=True, help_text='Blog post text', null=True),
),
]
| {"/ProjectApplication/project_core/forms/call.py": ["/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/call_part_file.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/grant_management/tests/test_models.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/variable_templates/tests/database_population.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/financial_key.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/views/logged/test_proposal.py": ["/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/views/logged/__init__.py"], "/ProjectApplication/project_core/tests/templatetags/test_short_filename_from_path.py": ["/ProjectApplication/project_core/templatetags/filename_from_path.py"], "/ProjectApplication/project_core/forms/proposal.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/fields.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/templatetags/thousands_separator.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/comments/tests/forms/test_comment.py": ["/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/variable_templates/tests/test_utils.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/models.py": ["/ProjectApplication/project_core/utils/SpiS3Boto3Storage.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/evaluation/admin.py": ["/ProjectApplication/evaluation/models.py"], "/ProjectApplication/project_core/utils/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/contacts.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py", "/ProjectApplication/project_core/utils/orcid.py"], "/ProjectApplication/project_core/management/commands/deleteunusedexternalkeywords.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/views/logged/call.py": ["/ProjectApplication/project_core/views/logged/funding_instrument.py", "/ProjectApplication/project_core/views/common/proposal.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/project_core/forms/postal_address.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/colours/admin.py": ["/ProjectApplication/colours/forms.py", "/ProjectApplication/colours/models.py"], "/ProjectApplication/project_core/forms/utils.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/management/commands/importorganisations.py": ["/ProjectApplication/project_core/management/commands/createorganisationnames.py"], "/ProjectApplication/comments/tests/forms/test_attachment.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/comments/tests/test_utils.py": ["/ProjectApplication/comments/forms/attachment.py", "/ProjectApplication/comments/forms/comment.py", "/ProjectApplication/comments/models.py"], "/ProjectApplication/grant_management/admin.py": ["/ProjectApplication/grant_management/models.py"], "/ProjectApplication/evaluation/forms/proposal_evaluation.py": ["/ProjectApplication/evaluation/models.py", "/ProjectApplication/evaluation/utils.py"], "/ProjectApplication/project_core/forms/call_part.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/tests/templatetags/test_ordinal.py": ["/ProjectApplication/project_core/templatetags/ordinal.py"], "/ProjectApplication/variable_templates/forms/template_variables.py": ["/ProjectApplication/variable_templates/models.py"], "/ProjectApplication/project_core/forms/funding_instrument.py": ["/ProjectApplication/project_core/models.py"], "/ProjectApplication/project_core/forms/partners.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/orcid.py", "/ProjectApplication/project_core/utils/utils.py"], "/ProjectApplication/project_core/forms/person.py": ["/ProjectApplication/project_core/forms/utils.py", "/ProjectApplication/project_core/utils/utils.py", "/ProjectApplication/project_core/widgets.py"], "/ProjectApplication/colours/forms.py": ["/ProjectApplication/colours/models.py"], "/ProjectApplication/grant_management/views.py": ["/ProjectApplication/grant_management/forms/close_project.py", "/ProjectApplication/grant_management/forms/datasets.py", "/ProjectApplication/grant_management/forms/locations.py", "/ProjectApplication/grant_management/forms/co_investigators.py", "/ProjectApplication/grant_management/forms/media.py", "/ProjectApplication/grant_management/forms/project.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.