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
4969aec5
Commit
4969aec5
authored
Sep 09, 2016
by
Clinton Blackburn
Committed by
GitHub
Sep 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the Program.category field (#309)
parent
cae32af5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
14 deletions
+23
-14
course_discovery/apps/api/serializers.py
+0
-1
course_discovery/apps/course_metadata/admin.py
+1
-1
course_discovery/apps/course_metadata/forms.py
+1
-3
course_discovery/apps/course_metadata/migrations/0025_remove_program_category.py
+18
-0
course_discovery/apps/course_metadata/models.py
+0
-2
course_discovery/apps/edx_catalog_extensions/migrations/0002_convert_program_category_to_type.py
+3
-7
No files found.
course_discovery/apps/api/serializers.py
View file @
4969aec5
...
...
@@ -49,7 +49,6 @@ COURSE_RUN_SEARCH_FIELDS = (
)
PROGRAM_FACET_FIELD_OPTIONS
=
{
'category'
:
{},
'status'
:
{},
'type'
:
{},
'seat_types'
:
{},
...
...
course_discovery/apps/course_metadata/admin.py
View file @
4969aec5
...
...
@@ -66,7 +66,7 @@ class CourseRunAdmin(admin.ModelAdmin):
class
ProgramAdmin
(
admin
.
ModelAdmin
):
form
=
ProgramAdminForm
inlines
=
[
FaqsInline
,
IndividualEndorsementInline
,
CorporateEndorsementsInline
]
list_display
=
(
'id'
,
'uuid'
,
'title'
,
'
category'
,
'
type'
,
'partner'
,
'status'
,)
list_display
=
(
'id'
,
'uuid'
,
'title'
,
'type'
,
'partner'
,
'status'
,)
list_filter
=
(
'partner'
,
'type'
,
'status'
,)
ordering
=
(
'uuid'
,
'title'
,
'status'
)
readonly_fields
=
(
'uuid'
,
'custom_course_runs_display'
,
'excluded_course_runs'
,)
...
...
course_discovery/apps/course_metadata/forms.py
View file @
4969aec5
...
...
@@ -10,9 +10,7 @@ from course_discovery.apps.course_metadata.models import Program, CourseRun
class
ProgramAdminForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Program
exclude
=
(
'category'
,
)
fields
=
'__all__'
widgets
=
{
'courses'
:
autocomplete
.
ModelSelect2Multiple
(
url
=
'admin_metadata:course-autocomplete'
,
...
...
course_discovery/apps/course_metadata/migrations/0025_remove_program_category.py
0 → 100644
View file @
4969aec5
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_metadata'
,
'0024_auto_20160901_1426'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'program'
,
name
=
'category'
,
),
]
course_discovery/apps/course_metadata/models.py
View file @
4969aec5
...
...
@@ -599,8 +599,6 @@ class Program(TimeStampedModel):
help_text
=
_
(
'The user-facing display title for this Program.'
),
max_length
=
255
,
unique
=
True
)
subtitle
=
models
.
CharField
(
help_text
=
_
(
'A brief, descriptive subtitle for the Program.'
),
max_length
=
255
,
blank
=
True
)
# TODO Remove category in favor of type
category
=
models
.
CharField
(
help_text
=
_
(
'The category / type of Program.'
),
max_length
=
32
)
type
=
models
.
ForeignKey
(
ProgramType
,
null
=
True
,
blank
=
True
)
status
=
models
.
CharField
(
help_text
=
_
(
'The lifecycle status of this Program.'
),
max_length
=
24
,
null
=
False
,
blank
=
False
,
db_index
=
True
,
...
...
course_discovery/apps/edx_catalog_extensions/migrations/0002_convert_program_category_to_type.py
View file @
4969aec5
...
...
@@ -4,12 +4,9 @@ from __future__ import unicode_literals
from
django.db
import
migrations
def
set_program_types
(
apps
,
schema_editor
):
Program
=
apps
.
get_model
(
'course_metadata'
,
'Program'
)
ProgramType
=
apps
.
get_model
(
'course_metadata'
,
'ProgramType'
)
xseries_type
=
ProgramType
.
objects
.
get
(
name
=
'XSeries'
)
Program
.
objects
.
filter
(
category__iexact
=
'xseries'
)
.
update
(
type
=
xseries_type
)
# NOTE (CCB): This migration is intentionally blank to avoid ghost migrations in production.
# The category field has been removed from the Program model. When we do squash migrations, this migration
# should be removed.
class
Migration
(
migrations
.
Migration
):
...
...
@@ -18,5 +15,4 @@ class Migration(migrations.Migration):
]
operations
=
[
migrations
.
RunPython
(
set_program_types
,
reverse_code
=
migrations
.
RunPython
.
noop
)
]
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