Commit 43941ef3 authored by Nicolas Joyard's avatar Nicolas Joyard

Fix API errors

parent c1cfcfd4
......@@ -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'},
}
......@@ -9,3 +9,6 @@ class RecommendationSerializer(serializers.HyperlinkedModelSerializer):
model = Recommendation
fields = ('recommendation', 'title', 'description', 'weight',
'proposal')
extra_kwargs = {
'proposal': {'view_name': 'api-proposal-detail'},
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment