From 7f01fd181bfda94af877ae99d4c1e47f7539fe8d Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 14 Mar 2017 19:24:54 +0100 Subject: [PATCH] Change user files paths --- app/organization/core/models.py | 4 +-- .../migrations/0092_auto_20170314_1918.py | 20 +++++++++++++ .../migrations/0053_auto_20170314_1918.py | 30 +++++++++++++++++++ app/organization/projects/models.py | 4 +-- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 app/organization/network/migrations/0092_auto_20170314_1918.py create mode 100644 app/organization/projects/migrations/0053_auto_20170314_1918.py diff --git a/app/organization/core/models.py b/app/organization/core/models.py index e53ea76c..4de84a75 100644 --- a/app/organization/core/models.py +++ b/app/organization/core/models.py @@ -140,7 +140,7 @@ class Image(Titled, Orderable): class UserImage(Titled, Orderable): - file = models.FileField(_("Image"), max_length=1024, upload_to="images") + file = models.FileField(_("Image"), max_length=1024, upload_to="user/images/%Y/%m/%d/") credits = models.CharField(_('credits'), max_length=256, blank=True, null=True) class Meta: @@ -157,7 +157,7 @@ class UserImage(Titled, Orderable): class File(Titled, Orderable): - file = FileField(_("document"), max_length=1024, upload_to="Documents/%Y/%m/%d/") + file = FileField(_("document"), max_length=1024, upload_to="documents") class Meta: abstract = True diff --git a/app/organization/network/migrations/0092_auto_20170314_1918.py b/app/organization/network/migrations/0092_auto_20170314_1918.py new file mode 100644 index 00000000..f43f5f01 --- /dev/null +++ b/app/organization/network/migrations/0092_auto_20170314_1918.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-14 18:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-network', '0091_auto_20170313_1425'), + ] + + operations = [ + migrations.AlterField( + model_name='organizationuserimage', + name='file', + field=models.FileField(max_length=1024, upload_to='user/images/%Y/%m/%d/', verbose_name='Image'), + ), + ] diff --git a/app/organization/projects/migrations/0053_auto_20170314_1918.py b/app/organization/projects/migrations/0053_auto_20170314_1918.py new file mode 100644 index 00000000..6b735eb5 --- /dev/null +++ b/app/organization/projects/migrations/0053_auto_20170314_1918.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-03-14 18:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-projects', '0052_auto_20170314_1828'), + ] + + operations = [ + migrations.AlterField( + model_name='projectprivatedata', + name='commitment_letter', + field=models.FileField(help_text='Written on behalf of the whole project consortium, this letter will commit in implementing the collaboration of a residency application selected by the VERTIGO jury, on the conditions set by the project (in annex of letter: synthesis of all related information entered by project).', max_length=1024, upload_to='user/documents/%Y/%m/%d/', verbose_name='letter of commitment by the project coordinator'), + ), + migrations.AlterField( + model_name='projectpublicdata', + name='image', + field=models.FileField(help_text='Representing the project', max_length=1024, upload_to='user/images/%Y/%m/%d/', verbose_name='Image'), + ), + migrations.AlterField( + model_name='projectuserimage', + name='file', + field=models.FileField(max_length=1024, upload_to='user/images/%Y/%m/%d/', verbose_name='Image'), + ), + ] diff --git a/app/organization/projects/models.py b/app/organization/projects/models.py index 1c28f7d9..75116285 100644 --- a/app/organization/projects/models.py +++ b/app/organization/projects/models.py @@ -341,7 +341,7 @@ class ProjectPublicData(models.Model): 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)") - image = models.FileField(_("Image"), max_length=1024, upload_to="images", help_text="Representing the project") + 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, blank=True, null=True) class Meta: @@ -355,7 +355,7 @@ class ProjectPrivateData(models.Model): description = models.TextField(_('project description'), help_text="(500 - 1000 words)") affiliation = models.CharField(_('affiliation'), max_length=512) - commitment_letter = models.FileField(_("letter of commitment by the project coordinator"), max_length=1024, upload_to="Documents/%Y/%m/%d/", help_text="Written on behalf of the whole project consortium, this letter will commit in implementing the collaboration of a residency application selected by the VERTIGO jury, on the conditions set by the project (in annex of letter: synthesis of all related information entered by project).") + commitment_letter = models.FileField(_("letter of commitment by the project coordinator"), max_length=1024, upload_to="user/documents/%Y/%m/%d/", help_text="Written on behalf of the whole project consortium, this letter will commit in implementing the collaboration of a residency application selected by the VERTIGO jury, on the conditions set by the project (in annex of letter: synthesis of all related information entered by project).") persons = models.CharField(_('persons'), max_length=512, help_text="First name and last name of the persons from organization / project who will be part preliminary of the project team (separated by a comma)") class Meta: -- 2.39.5