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
5b2b5230
Commit
5b2b5230
authored
Jul 06, 2018
by
Cole Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed PR feedback
parent
4f47ea74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
course_discovery/apps/course_metadata/migrations/0085_creditpathway.py
+9
-8
course_discovery/apps/course_metadata/models.py
+5
-6
course_discovery/apps/course_metadata/tests/test_models.py
+1
-2
No files found.
course_discovery/apps/course_metadata/migrations/0085_
auto_20180706_0029
.py
→
course_discovery/apps/course_metadata/migrations/0085_
creditpathway
.py
View file @
5b2b5230
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-07-06
00:29
# Generated by Django 1.11.11 on 2018-07-06
14:21
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django_extensions.db.fields
import
django_extensions.db.fields
import
sortedm2m.fields
import
sortedm2m.fields
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
...
@@ -20,14 +20,15 @@ class Migration(migrations.Migration):
...
@@ -20,14 +20,15 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
django_extensions
.
db
.
fields
.
CreationDateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'created'
)),
(
'created'
,
django_extensions
.
db
.
fields
.
CreationDateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'created'
)),
(
'modified'
,
django_extensions
.
db
.
fields
.
ModificationDateTimeField
(
auto_now
=
True
,
verbose_name
=
'modified'
)),
(
'modified'
,
django_extensions
.
db
.
fields
.
ModificationDateTimeField
(
auto_now
=
True
,
verbose_name
=
'modified'
)),
(
'name'
,
models
.
CharField
(
max_length
=
255
)),
(
'name'
,
models
.
CharField
(
max_length
=
255
,
unique
=
True
)),
(
'org_name'
,
models
.
CharField
(
max_length
=
255
,
verbose_name
=
'Organization name'
)),
(
'org_name'
,
models
.
CharField
(
max_length
=
255
,
verbose_name
=
'Organization name'
)),
(
'email'
,
models
.
EmailField
(
max_length
=
25
5
)),
(
'email'
,
models
.
EmailField
(
max_length
=
25
4
)),
(
'programs'
,
sortedm2m
.
fields
.
SortedManyToManyField
(
help_text
=
None
,
to
=
'course_metadata.Program'
)),
(
'programs'
,
sortedm2m
.
fields
.
SortedManyToManyField
(
help_text
=
None
,
to
=
'course_metadata.Program'
)),
],
],
),
options
=
{
migrations
.
AlterUniqueTogether
(
'get_latest_by'
:
'modified'
,
name
=
'creditpathway'
,
'abstract'
:
False
,
unique_together
=
set
([(
'name'
,
'org_name'
)]),
'ordering'
:
(
'-modified'
,
'-created'
),
},
),
),
]
]
course_discovery/apps/course_metadata/models.py
View file @
5b2b5230
...
@@ -1276,16 +1276,15 @@ class Program(TimeStampedModel):
...
@@ -1276,16 +1276,15 @@ class Program(TimeStampedModel):
class
CreditPathway
(
TimeStampedModel
):
class
CreditPathway
(
TimeStampedModel
):
""" Credit Pathway model """
""" Credit Pathway model """
name
=
models
.
CharField
(
max_length
=
255
)
name
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
)
# this field doesn't necessarily map to our normal org models, it's just a convenience field for pathways
# while we figure them out
org_name
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
"Organization name"
))
org_name
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
"Organization name"
))
email
=
models
.
EmailField
(
max_length
=
255
)
email
=
models
.
EmailField
()
programs
=
SortedManyToManyField
(
Program
)
programs
=
SortedManyToManyField
(
Program
)
def
__str__
(
self
):
def
__str__
(
self
):
return
"{org_name}: {name}"
.
format
(
org_name
=
self
.
org_name
,
name
=
self
.
name
)
return
self
.
name
class
Meta
(
object
):
unique_together
=
(
'name'
,
'org_name'
)
class
PersonSocialNetwork
(
AbstractSocialNetworkModel
):
class
PersonSocialNetwork
(
AbstractSocialNetworkModel
):
...
...
course_discovery/apps/course_metadata/tests/test_models.py
View file @
5b2b5230
...
@@ -1115,8 +1115,7 @@ class CreditPathwayTests(TestCase):
...
@@ -1115,8 +1115,7 @@ class CreditPathwayTests(TestCase):
def
test_str
(
self
):
def
test_str
(
self
):
credit_pathway
=
factories
.
CreditPathwayFactory
()
credit_pathway
=
factories
.
CreditPathwayFactory
()
self
.
assertEqual
(
str
(
credit_pathway
),
self
.
assertEqual
(
str
(
credit_pathway
),
credit_pathway
.
name
)
'{org_name}: {name}'
.
format
(
org_name
=
credit_pathway
.
org_name
,
name
=
credit_pathway
.
name
))
class
PersonSocialNetworkTests
(
TestCase
):
class
PersonSocialNetworkTests
(
TestCase
):
...
...
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