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
06e0d2f5
Commit
06e0d2f5
authored
Mar 21, 2018
by
Bessie Steinberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Journal model
parent
270aeba2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
1 deletions
+109
-1
course_discovery/apps/journal/migrations/0001_initial.py
+41
-0
course_discovery/apps/journal/models.py
+37
-1
course_discovery/apps/publisher/migrations/0065_auto_20180321_2002.py
+31
-0
No files found.
course_discovery/apps/journal/migrations/0001_initial.py
0 → 100644
View file @
06e0d2f5
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-21 20:02
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
django_extensions.db.fields
import
uuid
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
(
'core'
,
'0007_auto_20171004_1133'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Journal'
,
fields
=
[
(
'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'
)),
(
'modified'
,
django_extensions
.
db
.
fields
.
ModificationDateTimeField
(
auto_now
=
True
,
verbose_name
=
'modified'
)),
(
'uuid'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
verbose_name
=
'UUID'
)),
(
'key'
,
models
.
CharField
(
max_length
=
255
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
None
,
max_length
=
225
,
null
=
True
)),
(
'price'
,
models
.
DecimalField
(
decimal_places
=
2
,
default
=
0.0
,
max_digits
=
10
)),
(
'sku'
,
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
)),
(
'expires'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
(
'currency'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Currency'
)),
(
'partner'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Partner'
)),
],
options
=
{
'get_latest_by'
:
'modified'
,
'ordering'
:
(
'-modified'
,
'-created'
),
'abstract'
:
False
,
},
),
]
course_discovery/apps/journal/models.py
View file @
06e0d2f5
from
django.db
import
models
from
django_extensions.db.models
import
TimeStampedModel
from
uuid
import
uuid4
# Create your models here.
from
course_discovery.apps.core.models
import
Currency
,
Partner
class
Journal
(
TimeStampedModel
):
"""" Journal model """
PRICE_FIELD_CONFIG
=
{
'decimal_places'
:
2
,
'max_digits'
:
10
,
'null'
:
False
,
'default'
:
0.00
,
}
uuid
=
models
.
UUIDField
(
default
=
uuid4
,
editable
=
False
,
verbose_name
=
'UUID'
,
)
partner
=
models
.
ForeignKey
(
Partner
)
key
=
models
.
CharField
(
max_length
=
255
)
title
=
models
.
CharField
(
max_length
=
225
,
default
=
None
,
null
=
True
,
blank
=
True
)
price
=
models
.
DecimalField
(
**
PRICE_FIELD_CONFIG
)
currency
=
models
.
ForeignKey
(
Currency
)
sku
=
models
.
CharField
(
max_length
=
128
,
null
=
True
,
blank
=
True
)
expires
=
models
.
DateTimeField
(
null
=
True
,
blank
=
True
)
def
__str__
(
self
):
return
'{key}: {title}'
.
format
(
key
=
self
.
key
,
title
=
self
.
title
)
\ No newline at end of file
course_discovery/apps/publisher/migrations/0065_auto_20180321_2002.py
0 → 100644
View file @
06e0d2f5
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-21 20:02
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'publisher'
,
'0064_auto_20180125_1836'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'courserun'
,
name
=
'enrollment_end'
,
),
migrations
.
RemoveField
(
model_name
=
'courserun'
,
name
=
'enrollment_start'
,
),
migrations
.
RemoveField
(
model_name
=
'historicalcourserun'
,
name
=
'enrollment_end'
,
),
migrations
.
RemoveField
(
model_name
=
'historicalcourserun'
,
name
=
'enrollment_start'
,
),
]
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