Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
43941ef3
Commit
43941ef3
authored
Sep 08, 2016
by
Nicolas Joyard
Browse files
Fix API errors
parent
c1cfcfd4
Changes
2
Hide whitespace changes
Inline
Side-by-side
memopol_scores/serializers.py
View file @
43941ef3
...
...
@@ -12,6 +12,10 @@ class DossierScoreSerializer(serializers.HyperlinkedModelSerializer):
class
Meta
:
model
=
DossierScore
fields
=
(
'representative'
,
'dossier'
,
'score'
)
extra_kwargs
=
{
'representative'
:
{
'view_name'
:
'api-representative-detail'
},
'dossier'
:
{
'view_name'
:
'api-dossier-detail'
},
}
class
RepresentativeScoreSerializer
(
serializers
.
HyperlinkedModelSerializer
):
...
...
@@ -19,11 +23,16 @@ class RepresentativeScoreSerializer(serializers.HyperlinkedModelSerializer):
class
Meta
:
model
=
RepresentativeScore
fields
=
(
'representative'
,
'score'
)
extra_kwargs
=
{
'representative'
:
{
'view_name'
:
'api-representative-detail'
},
}
class
VoteScoreSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
model
=
VoteScore
fields
=
(
'vote__proposal'
,
'vote__representative'
,
'vote__position'
,
'score'
)
fields
=
(
'vote'
,
'score'
)
extra_kwargs
=
{
'vote'
:
{
'view_name'
:
'api-vote-detail'
},
}
representatives_recommendations/serializers.py
View file @
43941ef3
...
...
@@ -9,3 +9,6 @@ class RecommendationSerializer(serializers.HyperlinkedModelSerializer):
model
=
Recommendation
fields
=
(
'recommendation'
,
'title'
,
'description'
,
'weight'
,
'proposal'
)
extra_kwargs
=
{
'proposal'
:
{
'view_name'
:
'api-proposal-detail'
},
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment