Skip to content

Commit 215c1c0

Browse files
committed
Some docstrings
1 parent 1f9da42 commit 215c1c0

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

readthedocs/api/v3/views.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ class SubprojectRelationshipViewSet(APIv3Settings, APIAuthMixin,
175175
NestedViewSetMixin, FlexFieldsMixin, ListModelMixin,
176176
GenericViewSet):
177177

178+
"""
179+
List subprojects of a ``Project``.
180+
181+
The main query is done via the ``NestedViewSetMixin`` using the
182+
``parents_query_lookups`` defined when registering the urls.
183+
"""
184+
178185
model = Project
179186
lookup_field = 'slug'
180187
lookup_url_kwarg = 'project_slug'
@@ -186,6 +193,13 @@ class TranslationRelationshipViewSet(APIv3Settings, APIAuthMixin,
186193
NestedViewSetMixin, FlexFieldsMixin, ListModelMixin,
187194
GenericViewSet):
188195

196+
"""
197+
List translations of a ``Project``.
198+
199+
The main query is done via the ``NestedViewSetMixin`` using the
200+
``parents_query_lookups`` defined when registering the urls.
201+
"""
202+
189203
model = Project
190204
lookup_field = 'slug'
191205
lookup_url_kwarg = 'project_slug'
@@ -211,10 +225,6 @@ class VersionsViewSet(APIv3Settings, APIAuthMixin,
211225
'last_build.config',
212226
]
213227

214-
# NOTE: ``NestedViewSetMixin`` is really good, but if the ``project.slug``
215-
# does not exist it does not return 404, but 200 instead:
216-
# /api/v3/projects/nonexistent/versions/
217-
218228
def get_serializer_class(self):
219229
"""
220230
Return correct serializer depending on the action (GET or PUT/PATCH/POST).
@@ -230,7 +240,7 @@ def update(self, request, *args, **kwargs):
230240
Force to return 204 is the update was good.
231241
"""
232242

233-
# NOTE: ``Authorization: `` is mandatory to use this method from
243+
# NOTE: ``Authorization:`` header is mandatory to use this method from
234244
# Browsable API since SessionAuthentication can't be used because we set
235245
# ``httpOnly`` on our cookies and the ``PUT/PATCH`` method are triggered
236246
# via Javascript

0 commit comments

Comments
 (0)