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
18495e97
Commit
18495e97
authored
Jan 09, 2015
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add search, sort, and slug dropdown to Course Modes admin.
parent
fe40fa6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
common/djangoapps/course_modes/admin.py
+12
-1
No files found.
common/djangoapps/course_modes/admin.py
View file @
18495e97
...
...
@@ -13,6 +13,13 @@ class CourseModeForm(forms.ModelForm):
class
Meta
:
model
=
CourseMode
COURSE_MODE_SLUG_CHOICES
=
(
[(
CourseMode
.
DEFAULT_MODE_SLUG
,
CourseMode
.
DEFAULT_MODE_SLUG
)]
+
[(
mode_slug
,
mode_slug
)
for
mode_slug
in
CourseMode
.
VERIFIED_MODES
]
)
mode_slug
=
forms
.
ChoiceField
(
choices
=
COURSE_MODE_SLUG_CHOICES
)
def
clean_course_id
(
self
):
course_id
=
self
.
cleaned_data
[
'course_id'
]
try
:
...
...
@@ -31,6 +38,10 @@ class CourseModeForm(forms.ModelForm):
class
CourseModeAdmin
(
admin
.
ModelAdmin
):
form
=
CourseModeForm
search_fields
=
(
'course_id'
,)
list_display
=
(
'id'
,
'course_id'
,
'mode_slug'
,
'mode_display_name'
,
'min_price'
,
'suggested_prices'
,
'currency'
,
'expiration_date'
,
'expiration_datetime'
)
admin
.
site
.
register
(
CourseMode
,
CourseModeAdmin
)
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