forked from fccn/richie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(backend) add offer and price fields to courseRun
Add offer and price fields to courseRun displayed at admin view related to openfun#2445
- Loading branch information
1 parent
7a0bf9f
commit 84083cc
Showing
12 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/richie/apps/courses/migrations/0035_courserun_offer_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Generated by Django 4.2.13 on 2024-07-09 10:56 | ||
|
||
from django.db import migrations, models | ||
|
||
import richie.apps.core.fields.multiselect | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("courses", "0034_auto_20230817_1736"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courserun", | ||
name="offer", | ||
field=models.CharField( | ||
choices=[ | ||
( | ||
"free", | ||
"free - The entire course can be completed without cost", | ||
), | ||
( | ||
"partially_free", | ||
"partially_free - More than half of the course is for free", | ||
), | ||
( | ||
"subscription", | ||
"subscription - The user must be a subscriber or paid member in order to complete the entire course", | ||
), | ||
( | ||
"paid", | ||
"paid - The user must pay to complete the course", | ||
), | ||
], | ||
default="free", | ||
max_length=20, | ||
verbose_name="offer", | ||
), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
src/richie/apps/courses/migrations/0036_courserun_price_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.2.13 on 2024-07-09 14:37 | ||
|
||
from django.db import migrations, models | ||
|
||
import richie.apps.core.fields.multiselect | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("courses", "0035_courserun_offer_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courserun", | ||
name="price", | ||
field=models.FloatField( | ||
default=0.0, help_text="The cost of the course", verbose_name="price" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,8 @@ class Meta: | |
"state", | ||
"enrollment_count", | ||
"catalog_visibility", | ||
"offer", | ||
"price", | ||
] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters