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

Fix API errors

parent c1cfcfd4
...@@ -12,6 +12,10 @@ class DossierScoreSerializer(serializers.HyperlinkedModelSerializer): ...@@ -12,6 +12,10 @@ class DossierScoreSerializer(serializers.HyperlinkedModelSerializer):
class Meta: class Meta:
model = DossierScore model = DossierScore
fields = ('representative', 'dossier', 'score') fields = ('representative', 'dossier', 'score')
extra_kwargs = {
'representative': {'view_name': 'api-representative-detail'},
'dossier': {'view_name': 'api-dossier-detail'},
}
class RepresentativeScoreSerializer(serializers.HyperlinkedModelSerializer): class RepresentativeScoreSerializer(serializers.HyperlinkedModelSerializer):
...@@ -19,11 +23,16 @@ class RepresentativeScoreSerializer(serializers.HyperlinkedModelSerializer): ...@@ -19,11 +23,16 @@ class RepresentativeScoreSerializer(serializers.HyperlinkedModelSerializer):
class Meta: class Meta:
model = RepresentativeScore model = RepresentativeScore
fields = ('representative', 'score') fields = ('representative', 'score')
extra_kwargs = {
'representative': {'view_name': 'api-representative-detail'},
}
class VoteScoreSerializer(serializers.HyperlinkedModelSerializer): class VoteScoreSerializer(serializers.HyperlinkedModelSerializer):
class Meta: class Meta:
model = VoteScore model = VoteScore
fields = ('vote__proposal', 'vote__representative', 'vote__position', fields = ('vote', 'score')
'score') extra_kwargs = {
'vote': {'view_name': 'api-vote-detail'},
}
...@@ -9,3 +9,6 @@ class RecommendationSerializer(serializers.HyperlinkedModelSerializer): ...@@ -9,3 +9,6 @@ class RecommendationSerializer(serializers.HyperlinkedModelSerializer):
model = Recommendation model = Recommendation
fields = ('recommendation', 'title', 'description', 'weight', fields = ('recommendation', 'title', 'description', 'weight',
'proposal') '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