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

allow polls to be linked to circles

parent d1df3116
No related branches found
No related tags found
1 merge request!1Feature : sib polls
Pipeline #6903 failed
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-08-07 14:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('djangoldp_circle', '0009_auto_20200807_1413'),
('djangoldp_polls', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='poll',
name='circle',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='djangoldp_circle.Circle'),
),
]
......@@ -6,6 +6,7 @@ from django.contrib.auth import get_user_model
from django.db.models import Sum
from djangoldp_conversation.models import Conversation
from djangoldp_circle.models import Circle
User = get_user_model()
User.name=User.get_full_name
......@@ -54,7 +55,7 @@ class Poll (Model):
tags = models.ManyToManyField(Tag, related_name='tags', blank=True)
pollOptions = models.ManyToManyField(PollOption, related_name='relatedPollOptions', blank=True)
debate = models.ManyToManyField(Conversation, related_name='debates', blank=True)
#relatedVotes = models.ManyToManyField(Vote, related_name='relatedVotes', blank=True)
circle = models.ForeignKey(Circle, null=True, related_name="resources")
class Meta :
serializer_fields = ['@id','created_at','debate','pollOptions','votes','author','title','image','hostingOrganisation','startDate','endDate','shortDescription','longDescription','tags']
......
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