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
09d3f787
Commit
09d3f787
authored
Mar 29, 2018
by
Bill Filler
Committed by
Matt Tuchfarber
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update journal model with new fields
parent
cde06fac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
course_discovery/apps/journal/migrations/0005_auto_20180329_2009.py
+47
-0
course_discovery/apps/journal/models.py
+10
-2
No files found.
course_discovery/apps/journal/migrations/0005_auto_20180329_2009.py
0 → 100644
View file @
09d3f787
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-29 20:09
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_metadata'
,
'0080_seat_bulk_sku'
),
(
'journal'
,
'0004_journalbundle_partner'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'journal'
,
name
=
'expires'
,
),
migrations
.
AddField
(
model_name
=
'journal'
,
name
=
'access_length'
,
field
=
models
.
IntegerField
(
default
=
365
,
help_text
=
'number of days valid after purchase'
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'journal'
,
name
=
'card_image_url'
,
field
=
models
.
URLField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'journal'
,
name
=
'full_description'
,
field
=
models
.
TextField
(
blank
=
True
,
default
=
None
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'journal'
,
name
=
'organization'
,
field
=
models
.
ForeignKey
(
default
=
None
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'course_metadata.Organization'
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'journal'
,
name
=
'short_description'
,
field
=
models
.
CharField
(
default
=
None
,
max_length
=
350
),
),
]
course_discovery/apps/journal/models.py
View file @
09d3f787
...
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from
uuid
import
uuid4
from
course_discovery.apps.core.models
import
Currency
,
Partner
from
course_discovery.apps.course_metadata.models
import
Course
from
course_discovery.apps.course_metadata.models
import
Course
,
Organization
CHARFIELD_MAX_LENGTH
=
255
...
...
@@ -23,16 +23,24 @@ class Journal(TimeStampedModel):
verbose_name
=
_
(
'UUID'
),
)
partner
=
models
.
ForeignKey
(
Partner
)
organization
=
models
.
ForeignKey
(
Organization
)
title
=
models
.
CharField
(
max_length
=
CHARFIELD_MAX_LENGTH
,
default
=
None
,
null
=
True
,
blank
=
True
)
# ecommerce related
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
)
# marketing related fields
card_image_url
=
models
.
URLField
(
null
=
True
,
blank
=
True
)
short_description
=
models
.
CharField
(
max_length
=
350
,
default
=
None
,
null
=
False
)
full_description
=
models
.
TextField
(
default
=
None
,
null
=
True
,
blank
=
True
)
access_length
=
models
.
IntegerField
(
null
=
True
,
help_text
=
'number of days valid after purchase'
,
default
=
365
)
class
Meta
:
unique_together
=
(
...
...
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