Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
31b02700
Commit
31b02700
authored
May 23, 2017
by
Asad Azam
Committed by
AsadAzam
May 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display critical fields in admin
parent
31a294cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
course_discovery/apps/publisher/admin.py
+17
-0
No files found.
course_discovery/apps/publisher/admin.py
View file @
31b02700
...
@@ -19,6 +19,8 @@ from course_discovery.apps.publisher.models import (Course, CourseRun, CourseRun
...
@@ -19,6 +19,8 @@ from course_discovery.apps.publisher.models import (Course, CourseRun, CourseRun
class
CourseUserRoleAdmin
(
admin
.
ModelAdmin
):
class
CourseUserRoleAdmin
(
admin
.
ModelAdmin
):
form
=
CourseUserRoleForm
form
=
CourseUserRoleForm
raw_id_fields
=
(
'changed_by'
,)
raw_id_fields
=
(
'changed_by'
,)
list_display
=
[
'role'
,
'course'
,
'user'
]
search_fields
=
[
'course__title'
]
@admin.register
(
OrganizationExtension
)
@admin.register
(
OrganizationExtension
)
...
@@ -72,6 +74,8 @@ class UserAttributesAdmin(admin.ModelAdmin):
...
@@ -72,6 +74,8 @@ class UserAttributesAdmin(admin.ModelAdmin):
@admin.register
(
OrganizationUserRole
)
@admin.register
(
OrganizationUserRole
)
class
OrganizationUserRoleAdmin
(
admin
.
ModelAdmin
):
class
OrganizationUserRoleAdmin
(
admin
.
ModelAdmin
):
form
=
OrganizationUserRoleForm
form
=
OrganizationUserRoleForm
list_display
=
[
'role'
,
'organization'
,
'user'
]
search_fields
=
[
'organization__name'
]
role_groups_dict
=
{
role_groups_dict
=
{
InternalUserRole
.
MarketingReviewer
:
REVIEWER_GROUP_NAME
,
InternalUserRole
.
MarketingReviewer
:
REVIEWER_GROUP_NAME
,
InternalUserRole
.
ProjectCoordinator
:
PROJECT_COORDINATOR_GROUP_NAME
,
InternalUserRole
.
ProjectCoordinator
:
PROJECT_COORDINATOR_GROUP_NAME
,
...
@@ -91,22 +95,35 @@ class OrganizationUserRoleAdmin(admin.ModelAdmin):
...
@@ -91,22 +95,35 @@ class OrganizationUserRoleAdmin(admin.ModelAdmin):
@admin.register
(
CourseState
)
@admin.register
(
CourseState
)
class
CourseStateAdmin
(
admin
.
ModelAdmin
):
class
CourseStateAdmin
(
admin
.
ModelAdmin
):
raw_id_fields
=
(
'changed_by'
,)
raw_id_fields
=
(
'changed_by'
,)
list_display
=
[
'name'
,
'approved_by_role'
,
'owner_role'
,
'course'
,
'marketing_reviewed'
]
search_fields
=
[
'name'
]
@admin.register
(
CourseRunState
)
@admin.register
(
CourseRunState
)
class
CourseRunStateAdmin
(
admin
.
ModelAdmin
):
class
CourseRunStateAdmin
(
admin
.
ModelAdmin
):
raw_id_fields
=
(
'changed_by'
,)
raw_id_fields
=
(
'changed_by'
,)
list_display
=
[
'id'
,
'name'
,
'approved_by_role'
,
'owner_role'
,
'course_run'
,
'owner_role_modified'
,
'preview_accepted'
]
search_fields
=
[
'id'
,
'name'
]
ordering
=
[
'id'
]
@admin.register
(
Course
)
@admin.register
(
Course
)
class
CourseAdmin
(
admin
.
ModelAdmin
):
class
CourseAdmin
(
admin
.
ModelAdmin
):
raw_id_fields
=
(
'changed_by'
,)
raw_id_fields
=
(
'changed_by'
,)
list_display
=
[
'title'
,
'number'
]
search_fields
=
[
'title'
,
'number'
]
@admin.register
(
CourseRun
)
@admin.register
(
CourseRun
)
class
CourseRunAdmin
(
admin
.
ModelAdmin
):
class
CourseRunAdmin
(
admin
.
ModelAdmin
):
form
=
CourseRunAdminForm
form
=
CourseRunAdminForm
raw_id_fields
=
(
'changed_by'
,)
raw_id_fields
=
(
'changed_by'
,)
list_display
=
[
'course_name'
,
'lms_course_id'
,
'start'
,
'end'
]
search_fields
=
[
'id'
,
'lms_course_id'
,
'course__title'
]
def
course_name
(
self
,
obj
):
return
obj
.
course
.
title
@admin.register
(
Seat
)
@admin.register
(
Seat
)
...
...
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