urls.py 5.72 KB
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
from django.conf.urls import url, include
from rest_framework import routers
3
4
from backend.models.location import CountryViewSet
from backend.models.location import CityViewSet
Florent Chehab's avatar
Florent Chehab committed
5

6
7
8
9
10
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
11

12
13
14
15
16
17
18
19
20
21
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
22

23
24
25
26
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
27

28
29
30
31
32
33
34
35
36
37
38
39
from backend.models.university import UniversityViewSet
from backend.models.university import CampusViewSet
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
40
from backend.models.university import UniversityModulesViewSet
41

42
43
44
45
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
46

47
48
49
50
51
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
52

Florent Chehab's avatar
Florent Chehab committed
53
from rest_framework.documentation import include_docs_urls
Florent Chehab's avatar
Florent Chehab committed
54

Florent Chehab's avatar
Florent Chehab committed
55

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


router = routers.DefaultRouter()
router.register(r'country', CountryViewSet)
Florent Chehab's avatar
Florent Chehab committed
64
router.register(r'city', CityViewSet)
65
router.register(r'campus', CampusViewSet)
Florent Chehab's avatar
Florent Chehab committed
66
router.register(r'university', UniversityViewSet)
67

Florent Chehab's avatar
Florent Chehab committed
68
69
70
71
72
73

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
74
router.register(r'country_more/tourism', CountryTourismViewSet)
Florent Chehab's avatar
Florent Chehab committed
75
76
77
78
79
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
80
router.register(r'country_more/dri', CountryDriViewSet)
Florent Chehab's avatar
Florent Chehab committed
81

Florent Chehab's avatar
Florent Chehab committed
82
83
84
85
86
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
87

Florent Chehab's avatar
Florent Chehab committed
88
router.register(r'university_more/all/(?P<univ_id>[0-9]+)', UniversityModulesViewSet, "university_details")
89
90
91
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
92
93
router.register(r'university_more/semesters_dates',
                UniversitySemestersDatesViewSet)
94
95
96
97
98
99
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
100
router.register(r'university_more/dri', UniversityDriViewSet)
101

Florent Chehab's avatar
Florent Chehab committed
102
103
104
105
106
107
108
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
109
110
111
112
113
114
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)

Florent Chehab's avatar
Florent Chehab committed
115
router.register(r'university_more/previous_departure', PreviousDepartureViewSet)
116
router.register(r'university_more/previous_departure_feedback', PreviousDepartureFeedbackViewSet)
Florent Chehab's avatar
Florent Chehab committed
117
118
router.register(r'user/recommendation', RecommendationViewSet)
router.register(r'user/recommendations_list', RecommendationListViewSet)
119
router.register(r'user/data', UserDataViewSet)
Florent Chehab's avatar
Florent Chehab committed
120
121

urlpatterns += [url(r'^api/', include(router.urls))]