api.py 1.17 KB
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from rest_framework import routers

from representatives.api import (
    ConstituencyViewSet,
    GroupViewSet,
    MandateViewSet,
    RepresentativeViewSet,
)

from representatives_votes.api import (
    DossierViewSet,
    ProposalViewSet,
    VoteViewSet,
)

16
from representatives_recommendations.api import (
17
    DossierScoreViewSet,
18
19
    RecommendationViewSet,
    RepresentativeScoreViewSet,
20
    VoteScoreViewSet
21
22
23
)


Jamesie Pic's avatar
Jamesie Pic committed
24
25
router = routers.DefaultRouter()

26
27
28
29
30
31
32
33
34
35
36
37
38
router.register(r'constituencies', ConstituencyViewSet, 'api-constituency')
router.register(r'dossiers', DossierViewSet, 'api-dossier')
router.register(r'dossier_scores', DossierScoreViewSet, 'api-dossierscore')
router.register(r'groups', GroupViewSet, 'api-group')
router.register(r'mandates', MandateViewSet, 'api-mandate')
router.register(r'proposals', ProposalViewSet, 'api-proposal')
router.register(r'recommendations', RecommendationViewSet,
    'api-recommendation')
router.register(r'representatives', RepresentativeViewSet,
    'api-representative')
router.register(r'scores', RepresentativeScoreViewSet, 'api-score')
router.register(r'vote_scores', VoteScoreViewSet, 'api-votescore')
router.register(r'votes', VoteViewSet, 'api-vote')