api.py 1.25 KB
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1
2
3
from rest_framework import routers

from representatives.api import (
Nicolas Joyard's avatar
Nicolas Joyard committed
4
    ChamberViewSet,
Jamesie Pic's avatar
Jamesie Pic committed
5
6
7
8
9
10
11
12
13
14
15
16
    ConstituencyViewSet,
    GroupViewSet,
    MandateViewSet,
    RepresentativeViewSet,
)

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

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


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

Nicolas Joyard's avatar
Nicolas Joyard committed
27
router.register(r'chambers', ChamberViewSet, 'api-chamber')
28
29
30
31
32
33
34
35
36
37
38
39
40
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')