From d6b0aa4c781c304392861bf2f5e656201028c5b2 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 23 Mar 2017 10:39:56 +0100 Subject: [PATCH] Adapt project model and dates --- app/organization/core/models.py | 2 +- .../job/migrations/0012_auto_20170323_1039.py | 20 +++++++ .../migrations/0095_auto_20170323_1039.py | 25 +++++++++ app/organization/projects/forms.py | 5 +- .../migrations/0055_auto_20170323_1039.py | 52 +++++++++++++++++++ app/organization/projects/models.py | 3 +- 6 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 app/organization/job/migrations/0012_auto_20170323_1039.py create mode 100644 app/organization/network/migrations/0095_auto_20170323_1039.py create mode 100644 app/organization/projects/migrations/0055_auto_20170323_1039.py diff --git a/app/organization/core/models.py b/app/organization/core/models.py index 4de84a75..8d7d31d7 100644 --- a/app/organization/core/models.py +++ b/app/organization/core/models.py @@ -246,7 +246,7 @@ class Link(URL): class Period(models.Model): - date_from = models.DateField(_('begin date'), null=True, blank=True) + date_from = models.DateField(_('start date'), null=True, blank=True) date_to = models.DateField(_('end date'), null=True, blank=True) class Meta: diff --git a/app/organization/job/migrations/0012_auto_20170323_1039.py b/app/organization/job/migrations/0012_auto_20170323_1039.py new file mode 100644 index 00000000..4a9004dd --- /dev/null +++ b/app/organization/job/migrations/0012_auto_20170323_1039.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-23 09:39 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-job', '0011_auto_20170105_1743'), + ] + + operations = [ + migrations.AlterField( + model_name='candidacy', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + ] diff --git a/app/organization/network/migrations/0095_auto_20170323_1039.py b/app/organization/network/migrations/0095_auto_20170323_1039.py new file mode 100644 index 00000000..b5867377 --- /dev/null +++ b/app/organization/network/migrations/0095_auto_20170323_1039.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-23 09:39 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-network', '0094_auto_20170323_0815'), + ] + + operations = [ + migrations.AlterField( + model_name='personactivity', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + migrations.AlterField( + model_name='personactivityvacation', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + ] diff --git a/app/organization/projects/forms.py b/app/organization/projects/forms.py index 0a5b75b5..92ebe660 100644 --- a/app/organization/projects/forms.py +++ b/app/organization/projects/forms.py @@ -59,11 +59,12 @@ class ProjectForm(ModelForm): super(ProjectForm, self).__init__(*args, **kwargs) self.fields['title'].label = "Project name" self.fields['keywords'].help_text = "5 comma separated keywords" + self.fields['date_from'].help_text = "Project start date (DD/MM/YYYY)" + self.fields['date_to'].help_text = "Project end date (DD/MM/YYYY)" class Meta: model = Project - fields = ('title', 'keywords', 'website') - + fields = ('title', 'keywords', 'website', 'date_from', 'date_to') class ProjectPublicDataInline(InlineFormSet): diff --git a/app/organization/projects/migrations/0055_auto_20170323_1039.py b/app/organization/projects/migrations/0055_auto_20170323_1039.py new file mode 100644 index 00000000..6cd57d06 --- /dev/null +++ b/app/organization/projects/migrations/0055_auto_20170323_1039.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-23 09:39 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-projects', '0054_auto_20170323_0815'), + ] + + operations = [ + migrations.RemoveField( + model_name='projectpublicdata', + name='period', + ), + migrations.AddField( + model_name='projectpublicdata', + name='implementation_duration', + field=models.CharField(default='1', help_text='Possible duration of implementation in months (must be part of the project implementation workplan) (months)', max_length=128, verbose_name='implementation duration'), + ), + migrations.AddField( + model_name='projectpublicdata', + name='implementation_start_date', + field=models.DateField(default=datetime.datetime(2017, 3, 23, 9, 39, 34, 20133, tzinfo=utc), help_text='Possible start date of implementation (must be part of the project implementation workplan) (DD/MM/YYYY)', verbose_name='implementation start date'), + preserve_default=False, + ), + migrations.AlterField( + model_name='project', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + migrations.AlterField( + model_name='projectcall', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + migrations.AlterField( + model_name='projectresidency', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + migrations.AlterField( + model_name='projectworkpackage', + name='date_from', + field=models.DateField(blank=True, null=True, verbose_name='start date'), + ), + ] diff --git a/app/organization/projects/models.py b/app/organization/projects/models.py index 7be1b0a7..90effc06 100644 --- a/app/organization/projects/models.py +++ b/app/organization/projects/models.py @@ -340,7 +340,8 @@ class ProjectPublicData(models.Model): technology_description = models.TextField(_('technology description'), help_text="Must include the elements to be made available to the artist with sufficient functional and implementation details for enabling him/her to elaborate his/her technical approach (100-200 words).") objectives_description = models.TextField(_('objectives description'), help_text="What the project is looking to gain from the collaboration and what kind of artist would be suitable (100 – 150 words).") resources_description = models.TextField(_('resource description'), help_text="Resources available to the artist -- e.g. office facility, studio facility, technical equipment, internet connection, laboratory, and periods of availability for artistic production, staff possibly allocated to the project, available budget for travel, consumables and equipment, etc... (50 – 100 words).") - period = models.CharField(_('period of implementation'), max_length=128, help_text="Possible period of implementation (must be part of the project implementation workplan)") + implementation_start_date = models.DateField(_('implementation start date'), help_text="Possible start date of implementation (must be part of the project implementation workplan) (DD/MM/YYYY)") + implementation_duration = models.CharField(_('implementation duration'), max_length=128, help_text="Possible duration of implementation in months (must be part of the project implementation workplan) (months)", default='1') image = models.FileField(_("Image"), max_length=1024, upload_to="user/images/%Y/%m/%d/", help_text="Representing the project") image_credits = models.CharField(_('Image credits'), max_length=256, null=True) -- 2.39.5