api.py 1.31 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
    CountryViewSet,
Nicolas Joyard's avatar
Nicolas Joyard committed
5
    ChamberViewSet,
Jamesie Pic's avatar
Jamesie Pic committed
6
7
8
9
10
11
12
13
14
15
16
17
    ConstituencyViewSet,
    GroupViewSet,
    MandateViewSet,
    RepresentativeViewSet,
)

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

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


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

Nicolas Joyard's avatar
Nicolas Joyard committed
28
29
30
31
32
33
34
35
36
37
38
39
40
router.register('countries', CountryViewSet, 'api-country')
router.register('chambers', ChamberViewSet, 'api-chamber')
router.register('constituencies', ConstituencyViewSet, 'api-constituency')
router.register('dossiers', DossierViewSet, 'api-dossier')
router.register('dossier_scores', DossierScoreViewSet, 'api-dossierscore')
router.register('groups', GroupViewSet, 'api-group')
router.register('mandates', MandateViewSet, 'api-mandate')
router.register('proposals', ProposalViewSet, 'api-proposal')
router.register('recommendations', RecommendationViewSet, 'api-recommendation')
router.register('representatives', RepresentativeViewSet, 'api-representative')
router.register('scores', RepresentativeScoreViewSet, 'api-score')
router.register('vote_scores', VoteScoreViewSet, 'api-votescore')
router.register('votes', VoteViewSet, 'api-vote')