api_config.yml 6.29 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# THIS FILE IS USED TO GENERATE OTHER VERY IMPORTANT FILES
# BOTH IN THE FRONTEND AND IN THE BACKEND !
# TAKE CARE WHEN MODYFING IT ;)

# model : the model name (may be null)
# viewset : the viewset name for the api
# api_end_pont : the main part of the url for making request to the api
#  This string will also be used for naming variables in JS !!
#  So no weird characters there please...
# versionned: boolean to specify wether this model is versionned or not
# api_attr : to specify some attributes that may be captured
#  and used in the viewset
# requires_testing: boolean to tell if this viewset is only availble in
#  a testing environment.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Moderation levels are defined as follow :
#     0 : moderation will never be applied
#     1 : moderation will be on if the global settings for moderation is turned on
#     2 : (default for security reasons) moderation will always be on no matter what
# It is to be noted that staff members, dri members and moderators won't be subject to moderation !
# Dri might want to switch moderation on some models. TODO

# For viewset permissions we have the followings
# 
# By default, every viewset will have :
#     - isAuthentificated : to use the API the client needs to be authentificated
#     - noDeleteIsNotStaff : nothing can be deleted except if you are a staff member
#
# Some viewsets may have more presice permissions
#     - IsStaff
#     - IsStaffOrReadOnly
#     - IsDriOrReadOnly   
#     - IsOwner : (or )
# 
35

36
37
38
- model: Country
  viewset: CountryViewSet
  import_location: location
Florent Chehab's avatar
Florent Chehab committed
39
  api_end_point: countries
40
  viewset_permission: IsStaffOrReadOnly
41
42
43
44

- model: City
  viewset: CityViewSet
  import_location: location
Florent Chehab's avatar
Florent Chehab committed
45
  api_end_point: cities
46
  moderation_level: 2
47

Florent Chehab's avatar
Florent Chehab committed
48
49
- model: University
  viewset: UniversityViewSet
50
  import_location: university
Florent Chehab's avatar
Florent Chehab committed
51
  api_end_point: universities
52
  moderation_level: 2
53

Florent Chehab's avatar
Florent Chehab committed
54
55
- model: Campus
  viewset: CampusViewSet
56
  import_location: university
Florent Chehab's avatar
Florent Chehab committed
57
  api_end_point: campuses
58
  versionned: true
59
  moderation_level: 2
60
61


Florent Chehab's avatar
Florent Chehab committed
62
63
64
- model: UserData
  viewset: UserDataViewSet
  import_location: user
65
  api_end_point: userData
Florent Chehab's avatar
Florent Chehab committed
66
  api_name: user-data-detail
67
68
  moderation_level: 0
  viewset_permission: IsOwner
Florent Chehab's avatar
Florent Chehab committed
69
70
71
72
73
74


- model: Tag
  viewset: TagViewSet
  import_location: tag
  api_end_point: tags
75
76
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
77

78
79
- model: Currency
  viewset: CurrencyViewSet
Florent Chehab's avatar
Florent Chehab committed
80
  import_location: location
Florent Chehab's avatar
Florent Chehab committed
81
  api_end_point: currencies
82
83
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
84
85
86

- model: Department
  viewset: DepartmentViewSet
Florent Chehab's avatar
Florent Chehab committed
87
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
88
  api_end_point: departments
89
90
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
91
92
93

- model: Specialty
  viewset: SpecialtyViewSet
Florent Chehab's avatar
Florent Chehab committed
94
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
95
  api_end_point: specialties
96
97
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
98
99
100

- model: Semester
  viewset: SemesterViewSet
Florent Chehab's avatar
Florent Chehab committed
101
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
102
  api_end_point: semesters
103
104
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
105
106
107

- model: Offer
  viewset: OfferViewSet
Florent Chehab's avatar
Florent Chehab committed
108
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
109
  api_end_point: offers
110
111
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
Florent Chehab's avatar
Florent Chehab committed
112
113
114
115
116


- model: CountryTaggedItem
  viewset: CountryTaggedItemViewSet
  import_location: location
117
  api_end_point: countriesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
118
  versionned: true
119
120
121
122

- model: CountryScholarship
  viewset: CountryScholarshipViewSet
  import_location: location
123
  api_end_point: countriesScholarships
124
  versionned: true
125
126
127
128

- model: CountryDri
  viewset: CountryDriViewSet
  import_location: location
129
  api_end_point: countriesDri
130
  viewset_permission: IsDriOrReadOnly
131
  versionned: true
132
133


Florent Chehab's avatar
Florent Chehab committed
134
135
136
137

- model: CityTaggedItem
  viewset: CityTaggedItemViewSet
  import_location: location
138
  api_end_point: citiesTaggedItems
139
  versionned: true
140

Florent Chehab's avatar
Florent Chehab committed
141
142
143
144


- model: UniversityTaggedItem
  viewset: UniversityTaggedItemViewSet
145
  import_location: university
146
  api_end_point: universitiesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
147
  versionned: true
148
149
150
151

- model: UniversityScholarship
  viewset: UniversityScholarshipViewSet
  import_location: university
152
  api_end_point: universitiesScholarships
153
  versionned: true
154
155
156
157

- model: UniversityInfo
  viewset: UniversityInfoViewSet
  import_location: university
158
  api_end_point: universitiesInfo
159
  versionned: true
160
161
162
163

- model: UniversitySemestersDates
  viewset: UniversitySemestersDatesViewSet
  import_location: university
164
  api_end_point: universitiesSemestersDates
165
  versionned: true
166
167
168
169

- model: UniversityDri
  viewset: UniversityDriViewSet
  import_location: university
170
  api_end_point: universitiesDri
171
  viewset_permission: IsDriOrReadOnly
172
  versionned: true
173

174
- model: null
175
176
  viewset: UniversityModulesViewSet
  import_location: university
177
  api_end_point: universitiesAll
178
179
180
  api_attr: (?P<univ_id>[0-9]+)
  api_name: university_details

Florent Chehab's avatar
Florent Chehab committed
181
182
183
184
185


- model: CampusTaggedItem
  viewset: CampusTaggedItemViewSet
  import_location: university
186
  api_end_point: campusesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
187
188
189
190
191
  versionned: true

- model: null
  viewset: MainCampusViewSet
  import_location: university
192
  api_end_point: mainCampuses
Florent Chehab's avatar
Florent Chehab committed
193
194
195
196
  read_only: true



197
198
199
- model: Recommendation
  viewset: RecommendationViewSet
  import_location: user
200
  api_end_point: userRecommendations
201
  moderation_level: 0
202
203
204
205

- model: RecommendationList
  viewset: RecommendationListViewSet
  import_location: user
206
  api_end_point: userRecommendationLists
207
  moderation_level: 0
208
209
210
211

- model: PreviousDeparture
  viewset: PreviousDepartureViewSet
  import_location: user
212
  api_end_point: universitiesPreviousDepartures
213
  moderation_level: 2
214
215
216
217

- model: PreviousDepartureFeedback
  viewset: PreviousDepartureFeedbackViewSet
  import_location: user
218
  api_end_point: universitiesPreviousDepartureFeedback
Florent Chehab's avatar
Florent Chehab committed
219

220
221
222
223
224


- model: PendingModeration
  viewset: PendingModerationViewSet
  import_location: my_model
225
  api_end_point: pendingModeration
226
227
  viewset_permission: IsStaff

228
229
230
231

- model: Version
  viewset: VersionViewSet
  import_location: my_model
232
  api_end_point: versions
233
  api_attr: (?P<content_type_id>[0-9]+)/(?P<object_pk>[0-9A-Za-z]+)
234
  api_name: versionsList
235
  ignore_in_admin: true
236
237
238
239
240

- model: ForTestingModeration
  viewset: ForTestingModerationViewSet
  import_location: my_model
  api_end_point: test/moderation
241
  moderation_level: 1
242
243
244
245
246
247
  requires_testing: true

- model: ForTestingVersioning
  viewset: ForTestingVersioningViewSet
  import_location: my_model
  api_end_point: test/versioning
248
  moderation_level: 1
249
  requires_testing: true
250
  # versionned: true don't put it here, it is manually handled with @register decorator