Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
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-analytics-data-api
Commits
86802c1a
Commit
86802c1a
authored
Feb 27, 2015
by
Gabe Mulley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove a SELECT 1 query
Change-Id: I304bc445c5bb0fad123535eebfa1a3d69c6800fb
parent
e0fe7588
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
analytics_data_api/v0/views/courses.py
+2
-7
No files found.
analytics_data_api/v0/views/courses.py
View file @
86802c1a
...
...
@@ -39,19 +39,14 @@ class BaseCourseView(generics.ListAPIView):
return
super
(
BaseCourseView
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
def
verify_course_exists_or_404
(
self
,
course_id
):
if
self
.
model
.
objects
.
filter
(
course_id
=
course_id
)
.
exists
():
return
True
raise
Http404
def
apply_date_filtering
(
self
,
queryset
):
raise
NotImplementedError
def
get_queryset
(
self
):
self
.
verify_course_exists_or_404
(
self
.
course_id
)
queryset
=
self
.
model
.
objects
.
filter
(
course_id
=
self
.
course_id
)
queryset
=
self
.
apply_date_filtering
(
queryset
)
if
not
queryset
:
raise
Http404
return
queryset
def
get_csv_filename
(
self
):
...
...
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