Skip to content
Snippets Groups Projects
Commit ca7877eb authored by Maxime's avatar Maxime
Browse files

form models & migrations

parent a5b44d0f
No related branches found
No related tags found
1 merge request!1Feature : sib polls
Pipeline #6834 failed
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-17 14:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangoldp_polls', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='poll',
name='allow_create_backlink',
field=models.BooleanField(default=True, help_text='set to False to disable backlink creation after Model save'),
),
migrations.AddField(
model_name='poll',
name='is_backlink',
field=models.BooleanField(default=False, help_text='(DEPRECIATED) set automatically to indicate the Model is a backlink'),
),
migrations.AddField(
model_name='polloption',
name='allow_create_backlink',
field=models.BooleanField(default=True, help_text='set to False to disable backlink creation after Model save'),
),
migrations.AddField(
model_name='polloption',
name='is_backlink',
field=models.BooleanField(default=False, help_text='(DEPRECIATED) set automatically to indicate the Model is a backlink'),
),
migrations.AddField(
model_name='tag',
name='allow_create_backlink',
field=models.BooleanField(default=True, help_text='set to False to disable backlink creation after Model save'),
),
migrations.AddField(
model_name='tag',
name='is_backlink',
field=models.BooleanField(default=False, help_text='(DEPRECIATED) set automatically to indicate the Model is a backlink'),
),
migrations.AddField(
model_name='vote',
name='allow_create_backlink',
field=models.BooleanField(default=True, help_text='set to False to disable backlink creation after Model save'),
),
migrations.AddField(
model_name='vote',
name='is_backlink',
field=models.BooleanField(default=False, help_text='(DEPRECIATED) set automatically to indicate the Model is a backlink'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-01 08:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangoldp_conversation', '0006_auto_20200617_1309'),
('djangoldp_polls', '0002_auto_20200617_1440'),
]
operations = [
migrations.AddField(
model_name='poll',
name='debate',
field=models.ManyToManyField(blank=True, related_name='debate', to='djangoldp_conversation.Conversation'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-01 08:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('djangoldp_polls', '0003_poll_debate'),
]
operations = [
migrations.RemoveField(
model_name='poll',
name='debate',
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-23 10:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangoldp_polls', '0004_remove_poll_debate'),
]
operations = [
migrations.AddField(
model_name='poll',
name='startDate',
field=models.DateField(blank=True, null=True, verbose_name='Date de début'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-23 11:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangoldp_polls', '0005_poll_startdate'),
]
operations = [
migrations.RemoveField(
model_name='tag',
name='name',
),
migrations.AddField(
model_name='tag',
name='tag',
field=models.CharField(default=1, max_length=250, verbose_name='Tags related to the vote'),
preserve_default=False,
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-23 21:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('djangoldp_polls', '0006_auto_20200723_1139'),
]
operations = [
migrations.RenameField(
model_name='tag',
old_name='tag',
new_name='name',
),
]
......@@ -5,6 +5,7 @@ from djangoldp.models import Model
from django.contrib.auth import get_user_model
from django.db.models import Sum
from djangoldp_conversation.models import Conversation
User = get_user_model()
User.name=User.get_full_name
......@@ -46,16 +47,17 @@ class Poll (Model):
title = models.CharField(max_length=250,verbose_name="Title")
image = models.URLField(blank=True, null=True, verbose_name="Illustration de l'évènement")
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" )
shortDescription = models.CharField(max_length=250,verbose_name="Short description")
longDescription = models.TextField(verbose_name="Long description")
tags = models.ManyToManyField(Tag, related_name='tags', blank=True)
pollOptions = models.ManyToManyField(PollOption, related_name='relatedPollOptions', blank=True)
#debate = models.ManyToManyField(Debate, related_name='debate', blank=True)
#debate = models.ManyToManyField(Conversation, related_name='debate', blank=True)
#relatedVotes = models.ManyToManyField(Vote, related_name='relatedVotes', blank=True)
class Meta :
serializer_fields = ['@id','created_at','pollOptions','votes','author','title','image','hostingOrganisation','endDate','shortDescription','longDescription','tags']
serializer_fields = ['@id','created_at','pollOptions','votes','author','title','image','hostingOrganisation','startDate','endDate','shortDescription','longDescription','tags']
nested_fields = ['tags','votes','pollOptions']
anonymous_perms = ['view','add','change']
authenticated_perms = ['inherit','add']
......@@ -75,4 +77,5 @@ class Vote (Model):
serializer_fields = ['@id','chosenOption','relatedPoll']
nested_fields = []
anonymous_perms = ['view','add','change']
authenticated_perms = ['inherit','add']
\ No newline at end of file
authenticated_perms = ['inherit','add']
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment