From e24b92d4917feb435fca59389ad0d4691ffb671a Mon Sep 17 00:00:00 2001 From: senza <maximesenzamici@gmail.com> Date: Tue, 18 Aug 2020 12:30:28 +0200 Subject: [PATCH] add default image to poll --- .../migrations/0003_auto_20200814_0959.py | 37 +++++++++++++++++++ .../migrations/0004_auto_20200818_1014.py | 20 ++++++++++ .../migrations/0005_auto_20200818_1024.py | 20 ++++++++++ .../migrations/0006_auto_20200818_1024.py | 20 ++++++++++ .../migrations/0007_auto_20200818_1027.py | 20 ++++++++++ djangoldp_polls/models.py | 6 +-- 6 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 djangoldp_polls/migrations/0003_auto_20200814_0959.py create mode 100644 djangoldp_polls/migrations/0004_auto_20200818_1014.py create mode 100644 djangoldp_polls/migrations/0005_auto_20200818_1024.py create mode 100644 djangoldp_polls/migrations/0006_auto_20200818_1024.py create mode 100644 djangoldp_polls/migrations/0007_auto_20200818_1027.py diff --git a/djangoldp_polls/migrations/0003_auto_20200814_0959.py b/djangoldp_polls/migrations/0003_auto_20200814_0959.py new file mode 100644 index 0000000..aaffbfe --- /dev/null +++ b/djangoldp_polls/migrations/0003_auto_20200814_0959.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-08-14 09:59 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_polls', '0002_poll_circle'), + ] + + operations = [ + migrations.AlterField( + model_name='poll', + name='circle', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polls', to='djangoldp_circle.Circle'), + ), + migrations.AlterField( + model_name='poll', + name='debate', + field=models.ManyToManyField(blank=True, related_name='polls', to='djangoldp_conversation.Conversation'), + ), + migrations.AlterField( + model_name='poll', + name='tags', + field=models.ManyToManyField(blank=True, related_name='polls', to='djangoldp_polls.Tag'), + ), + migrations.AlterField( + model_name='vote', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='votes', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/djangoldp_polls/migrations/0004_auto_20200818_1014.py b/djangoldp_polls/migrations/0004_auto_20200818_1014.py new file mode 100644 index 0000000..05a70d5 --- /dev/null +++ b/djangoldp_polls/migrations/0004_auto_20200818_1014.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-08-18 10:14 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_polls', '0003_auto_20200814_0959'), + ] + + operations = [ + migrations.AlterField( + model_name='poll', + name='image', + field=models.URLField(default='./img/default-poll.png', verbose_name="Illustration de l'évènement"), + ), + ] diff --git a/djangoldp_polls/migrations/0005_auto_20200818_1024.py b/djangoldp_polls/migrations/0005_auto_20200818_1024.py new file mode 100644 index 0000000..4f6c182 --- /dev/null +++ b/djangoldp_polls/migrations/0005_auto_20200818_1024.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-08-18 10:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_polls', '0004_auto_20200818_1014'), + ] + + operations = [ + migrations.AlterField( + model_name='poll', + name='image', + field=models.URLField(default='/media/default-image.png', verbose_name="Illustration de l'évènement"), + ), + ] diff --git a/djangoldp_polls/migrations/0006_auto_20200818_1024.py b/djangoldp_polls/migrations/0006_auto_20200818_1024.py new file mode 100644 index 0000000..37ba8a5 --- /dev/null +++ b/djangoldp_polls/migrations/0006_auto_20200818_1024.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-08-18 10:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_polls', '0005_auto_20200818_1024'), + ] + + operations = [ + migrations.AlterField( + model_name='poll', + name='image', + field=models.URLField(default='./media/default-image.png', verbose_name="Illustration de l'évènement"), + ), + ] diff --git a/djangoldp_polls/migrations/0007_auto_20200818_1027.py b/djangoldp_polls/migrations/0007_auto_20200818_1027.py new file mode 100644 index 0000000..36b607c --- /dev/null +++ b/djangoldp_polls/migrations/0007_auto_20200818_1027.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-08-18 10:27 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_polls', '0006_auto_20200818_1024'), + ] + + operations = [ + migrations.AlterField( + model_name='poll', + name='image', + field=models.URLField(default='/media/default-image.png', verbose_name="Illustration de l'évènement"), + ), + ] diff --git a/djangoldp_polls/models.py b/djangoldp_polls/models.py index 484d117..7be67b7 100644 --- a/djangoldp_polls/models.py +++ b/djangoldp_polls/models.py @@ -43,10 +43,10 @@ class Poll (Model): created_at = models.DateTimeField(auto_now_add=True) author = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='createdVotes', null=True,blank=True) title = models.CharField(max_length=250,verbose_name="Title") - image = models.URLField(blank=True, null=True, verbose_name="Illustration de l'évènement") + image = models.URLField(verbose_name="Illustration",default=settings.BASE_URL +"/media/default-image.png") hostingOrganisation = models.CharField(max_length=250,verbose_name="Name of the hosting organisation") - startDate = models.DateField(verbose_name="Date de début", blank=True, null=True ) - endDate = models.DateField(verbose_name="Date de fin" ) + startDate = models.DateField(verbose_name="Start date", blank=True, null=True ) + endDate = models.DateField(verbose_name="End data" ) shortDescription = models.CharField(max_length=250,verbose_name="Short description") longDescription = models.TextField(verbose_name="Long description") tags = models.ManyToManyField(Tag, related_name='polls', blank=True) -- GitLab