Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-polls
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Applications
etuc
djangoldp-polls
Commits
ede607cb
Commit
ede607cb
authored
4 years ago
by
Maxime
Browse files
Options
Downloads
Patches
Plain Diff
allow polls to be linked to circles
parent
d1df3116
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Feature : sib polls
Pipeline
#6903
failed
4 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
djangoldp_polls/migrations/0002_poll_circle.py
+22
-0
22 additions, 0 deletions
djangoldp_polls/migrations/0002_poll_circle.py
djangoldp_polls/models.py
+2
-1
2 additions, 1 deletion
djangoldp_polls/models.py
with
24 additions
and
1 deletion
djangoldp_polls/migrations/0002_poll_circle.py
0 → 100644
+
22
−
0
View file @
ede607cb
# -*- 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
'
),
),
]
This diff is collapsed.
Click to expand it.
djangoldp_polls/models.py
+
2
−
1
View file @
ede607cb
...
...
@@ -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(Vot
e, related_name=
'
re
latedVotes', blank=True
)
circle
=
models
.
ForeignKey
(
Circle
,
null
=
Tru
e
,
related_name
=
"
re
sources
"
)
class
Meta
:
serializer_fields
=
[
'
@id
'
,
'
created_at
'
,
'
debate
'
,
'
pollOptions
'
,
'
votes
'
,
'
author
'
,
'
title
'
,
'
image
'
,
'
hostingOrganisation
'
,
'
startDate
'
,
'
endDate
'
,
'
shortDescription
'
,
'
longDescription
'
,
'
tags
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment