Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
89164bb6
Commit
89164bb6
authored
Jun 17, 2016
by
Peter Desjardins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the YAML docstring into a method docstring.
parent
d65cddd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
lms/djangoapps/course_api/views.py
+30
-29
No files found.
lms/djangoapps/course_api/views.py
View file @
89164bb6
...
...
@@ -188,35 +188,6 @@ class CourseListView(DeveloperErrorViewMixin, ListAPIView):
}
]
---
# YAML
omit_serializer: true
parameters:
- name: mobile
description: If specified, only visible `CourseOverview`
objects that are designated as mobile_available are returned.
required: false
type: string
paramType: query
- name: org
description: If specified, visible `CourseOverview` objects are filtered
such that only those belonging to the organization with the
provided org code (e.g., "HarvardX") are returned.
Case-insensitive.
required: false
type: string
paramType: query
- name: username
description: The username of the specified user whose visible courses we
want to see. The username is not required only if the API is
requested by an Anonymous user.
required: false
type: string
paramType: query
"""
pagination_class
=
NamespacedPageNumberPagination
...
...
@@ -225,6 +196,36 @@ class CourseListView(DeveloperErrorViewMixin, ListAPIView):
def
get_queryset
(
self
):
"""
Return a list of courses visible to the user.
---
# YAML
omit_serializer: true
parameters:
- name: mobile
description: If specified, only visible `CourseOverview`
objects that are designated as mobile_available are returned.
required: false
type: string
paramType: query
- name: org
description: If specified, visible `CourseOverview` objects are filtered
such that only those belonging to the organization with the
provided org code (e.g., "HarvardX") are returned.
Case-insensitive.
required: false
type: string
paramType: query
- name: username
description: The username of the specified user whose visible courses we
want to see. The username is not required only if the API is
requested by an Anonymous user.
required: false
type: string
paramType: query
"""
form
=
CourseListGetForm
(
self
.
request
.
query_params
,
initial
=
{
'requesting_user'
:
self
.
request
.
user
})
if
not
form
.
is_valid
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment