-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🗃️(backend/core) add
display_mode
field to CourseRun
model
Editor users wants to be able to customize the look'n feel of Joanie Product widget. To take this need, we add a `display_mode` choice field to `CourseRun` model then bind this new field to the React widget props serializer. In this way, frontend will be aware in which mode joanie product should be displayed.
- Loading branch information
Showing
10 changed files
with
98 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
68 changes: 68 additions & 0 deletions
68
src/richie/apps/courses/migrations/0034_auto_20230817_1736.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,68 @@ | ||
# Generated by Django 3.2.20 on 2023-08-17 15:36 | ||
|
||
from django.db import migrations, models | ||
|
||
import richie.apps.core.fields.duration | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("courses", "0033_auto_20211207_2251"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courserun", | ||
name="display_mode", | ||
field=models.CharField( | ||
choices=[ | ||
( | ||
"compact", | ||
"compact - show minimal information about the course run (only for products).", | ||
), | ||
( | ||
"detailed", | ||
"detailed - show all information about the course run (only for products).", | ||
), | ||
], | ||
default="detailed", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="course", | ||
name="effort", | ||
field=richie.apps.core.fields.duration.CompositeDurationField( | ||
blank=True, | ||
default_unit="hour", | ||
help_text="Total amount of time to complete this course.", | ||
max_length=80, | ||
null=True, | ||
time_units={"hour": ("hour", "hours"), "minute": ("minute", "minutes")}, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="courserun", | ||
name="enrollment_count", | ||
field=models.PositiveIntegerField( | ||
blank=True, | ||
default=0, | ||
help_text="The number of enrolled students", | ||
verbose_name="enrollment count", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="courserun", | ||
name="sync_mode", | ||
field=models.CharField( | ||
choices=[ | ||
("manual", "Manual"), | ||
("sync_to_draft", "Synchronization to draft page"), | ||
("sync_to_public", "Synchronization to public page"), | ||
], | ||
default="manual", | ||
max_length=20, | ||
verbose_name="Synchronization mode", | ||
), | ||
), | ||
] |
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 |
---|---|---|
|
@@ -38,6 +38,7 @@ class Meta: | |
"enrollment_end", | ||
"languages", | ||
"catalog_visibility", | ||
"display_mode", | ||
"snapshot", | ||
] | ||
|
||
|
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