urls.py 6.3 KB
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
from django.conf.urls import url, include
2
3
from django.conf import settings

Florent Chehab's avatar
Florent Chehab committed
4
from rest_framework import routers
5
6
from backend.models.location import CountryViewSet
from backend.models.location import CityViewSet
Florent Chehab's avatar
Florent Chehab committed
7

8
9
10
11
12
from backend.models.module import CurrencyViewSet
from backend.models.otherCore import DepartmentViewSet
from backend.models.otherCore import OfferViewSet
from backend.models.otherCore import SemesterViewSet
from backend.models.otherCore import SpecialtyViewSet
Florent Chehab's avatar
Florent Chehab committed
13

14
15
16
17
18
19
20
21
22
23
from backend.models.location import CountryCultureViewSet
from backend.models.location import CountryHealthInsuranceViewSet
from backend.models.location import CountryOtherInsuranceViewSet
from backend.models.location import CountryTransportViewSet
from backend.models.location import CountryTourismViewSet
from backend.models.location import CountryOtherStuffViewSet
from backend.models.location import CountryVisaAdministrativeViewSet
from backend.models.location import CountryPhotoViewSet
from backend.models.location import CountryScholarshipViewSet
from backend.models.location import CountryDriViewSet
Florent Chehab's avatar
Florent Chehab committed
24

25
26
27
28
from backend.models.location import CityTransportViewSet
from backend.models.location import CityTourismViewSet
from backend.models.location import CityOtherStuffViewSet
from backend.models.location import CityPhotoViewSet
Florent Chehab's avatar
Florent Chehab committed
29

30
from backend.models.university import UniversityViewSet
31
from backend.models.university import CampusViewSet, MainCampusViewSet
32
33
34
35
36
37
38
39
40
41
from backend.models.university import UniversityScholarshipViewSet
from backend.models.university import UniversityInfoViewSet
from backend.models.university import UniversitySemestersDatesViewSet
from backend.models.university import UniversityInsuranceViewSet
from backend.models.university import UniversityCoursesViewSet
from backend.models.university import UniversityCultureViewSet
from backend.models.university import UniversityOtherStuffViewSet
from backend.models.university import UniversitySpecialOfferViewSet
from backend.models.university import UniversityPhotoViewSet
from backend.models.university import UniversityDriViewSet
Florent Chehab's avatar
Florent Chehab committed
42
from backend.models.university import UniversityModulesViewSet
43

44
45
46
47
from backend.models.university import CampusTransportViewSet
from backend.models.university import CampusAccommodationViewSet
from backend.models.university import CampusCultureAndStudentLifeViewSet
from backend.models.university import CampusOtherStuffViewSet
Florent Chehab's avatar
Florent Chehab committed
48

49
50
51
52
53
from backend.models.user import RecommendationViewSet
from backend.models.user import RecommendationListViewSet
from backend.models.user import PreviousDepartureViewSet
from backend.models.user import PreviousDepartureFeedbackViewSet
from backend.models.user import UserDataViewSet
Florent Chehab's avatar
Florent Chehab committed
54

Florent Chehab's avatar
Florent Chehab committed
55
from backend.models.my_model import PendingModerationViewSet
56

Florent Chehab's avatar
Florent Chehab committed
57
from rest_framework.documentation import include_docs_urls
Florent Chehab's avatar
Florent Chehab committed
58

Florent Chehab's avatar
Florent Chehab committed
59

Florent Chehab's avatar
Florent Chehab committed
60
urlpatterns = [
61
    # url(r'^$', views.home, name='home'),
Florent Chehab's avatar
Florent Chehab committed
62
    url(r'^api-docs/', include_docs_urls(title='Outgoing API'))
Florent Chehab's avatar
linting  
Florent Chehab committed
63
]
Florent Chehab's avatar
Florent Chehab committed
64
65
66


router = routers.DefaultRouter()
67
68

if settings.TESTING:
Florent Chehab's avatar
Florent Chehab committed
69
70
    from backend.models.my_model import ForTestingModerationViewSet
    from backend.models.my_model import ForTestingVersionningViewSet
71
    router.register(r'test/moderation', ForTestingModerationViewSet)
Florent Chehab's avatar
Florent Chehab committed
72
    router.register(r'test/versionning', ForTestingVersionningViewSet)
73

Florent Chehab's avatar
Florent Chehab committed
74
router.register(r'country', CountryViewSet)
Florent Chehab's avatar
Florent Chehab committed
75
router.register(r'city', CityViewSet)
76
router.register(r'campus', CampusViewSet)
77
router.register(r'main_campus', MainCampusViewSet)
Florent Chehab's avatar
Florent Chehab committed
78
router.register(r'university', UniversityViewSet)
79

Florent Chehab's avatar
Florent Chehab committed
80
81
82
83
84
85

router.register(r'country_more/culture', CountryCultureViewSet)
router.register(r'country_more/health_insurance',
                CountryHealthInsuranceViewSet)
router.register(r'country_more/other_insurance', CountryOtherInsuranceViewSet)
router.register(r'country_more/transport', CountryTransportViewSet)
Florent Chehab's avatar
Florent Chehab committed
86
router.register(r'country_more/tourism', CountryTourismViewSet)
Florent Chehab's avatar
Florent Chehab committed
87
88
89
90
91
router.register(r'country_more/other_stuff', CountryOtherStuffViewSet)
router.register(r'country_more/visa_administrative',
                CountryVisaAdministrativeViewSet)
router.register(r'country_more/photos', CountryPhotoViewSet)
router.register(r'country_more/scholarship', CountryScholarshipViewSet)
Florent Chehab's avatar
Florent Chehab committed
92
router.register(r'country_more/dri', CountryDriViewSet)
Florent Chehab's avatar
Florent Chehab committed
93

Florent Chehab's avatar
Florent Chehab committed
94
95
96
97
98
router.register(r'city_more/transport', CityTransportViewSet)
router.register(r'city_more/tourism', CityTourismViewSet)
router.register(r'city_more/other_stuff', CityOtherStuffViewSet)
router.register(r'city_more/photos', CityPhotoViewSet)

Florent Chehab's avatar
Florent Chehab committed
99

100
101
router.register(
    r'university_more/all/(?P<univ_id>[0-9]+)', UniversityModulesViewSet, "university_details")
102
103
104
router.register(r'university_more/scholarship', UniversityScholarshipViewSet)
router.register(r'university_more/info', UniversityInfoViewSet)
router.register(r'university_more/insurance', UniversityInsuranceViewSet)
Florent Chehab's avatar
Florent Chehab committed
105
106
router.register(r'university_more/semesters_dates',
                UniversitySemestersDatesViewSet)
107
108
109
110
111
112
router.register(r'university_more/courses', UniversityCoursesViewSet)
router.register(r'university_more/culture', UniversityCultureViewSet)
router.register(r'university_more/other_stuff', UniversityOtherStuffViewSet)
router.register(r'university_more/photos', UniversityPhotoViewSet)
router.register(r'university_more/special_offer',
                UniversitySpecialOfferViewSet)
Florent Chehab's avatar
Florent Chehab committed
113
router.register(r'university_more/dri', UniversityDriViewSet)
114

Florent Chehab's avatar
Florent Chehab committed
115
116
117
118
119
120
121
router.register(r'campus_more/culture_and_sl',
                CampusCultureAndStudentLifeViewSet)
router.register(r'campus_more/accomodation', CampusAccommodationViewSet)
router.register(r'campus_more/transport', CampusTransportViewSet)
router.register(r'campus_more/other_tuff', CampusOtherStuffViewSet)


Florent Chehab's avatar
Florent Chehab committed
122
123
124
125
126
127
router.register(r'other/currency', CurrencyViewSet)
router.register(r'other/semester', SemesterViewSet)
router.register(r'other/department', DepartmentViewSet)
router.register(r'other/specialty', SpecialtyViewSet)
router.register(r'other/offer', OfferViewSet)

128
129
130
131
router.register(r'university_more/previous_departure',
                PreviousDepartureViewSet)
router.register(r'university_more/previous_departure_feedback',
                PreviousDepartureFeedbackViewSet)
Florent Chehab's avatar
Florent Chehab committed
132
133
router.register(r'user/recommendation', RecommendationViewSet)
router.register(r'user/recommendations_list', RecommendationListViewSet)
Florent Chehab's avatar
Florent Chehab committed
134
router.register(r'user/data', UserDataViewSet, "user_data-detail")
Florent Chehab's avatar
Florent Chehab committed
135

136
137
router.register(r'pending_moderation', PendingModerationViewSet)

Florent Chehab's avatar
Florent Chehab committed
138
urlpatterns += [url(r'^api/', include(router.urls))]