-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add RestrictedCourseRun model (#4318)
- Loading branch information
Showing
6 changed files
with
94 additions
and
3 deletions.
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
34 changes: 34 additions & 0 deletions
34
course_discovery/apps/course_metadata/migrations/0341_restrictedcourserun.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,34 @@ | ||
# Generated by Django 4.2.11 on 2024-04-09 09:34 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.db.models.manager | ||
import django_extensions.db.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('course_metadata', '0340_auto_20231211_1032'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='RestrictedCourseRun', | ||
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')), | ||
('draft', models.BooleanField(default=False, help_text='Is this a draft version?')), | ||
('restriction_type', models.CharField(blank=True, choices=[('custom-b2b-enterprise', 'Custom B2B Enterprise'), ('custom-b2c', 'Custom B2C')], help_text='The type of restriction for the above course run', max_length=255, null=True)), | ||
('course_run', models.OneToOneField(help_text='Course Run that will be restricted', on_delete=django.db.models.deletion.CASCADE, related_name='restricted_run', to='course_metadata.courserun')), | ||
('draft_version', models.OneToOneField(blank=True, limit_choices_to={'draft': True}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='_official_version', to='course_metadata.restrictedcourserun')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
managers=[ | ||
('everything', django.db.models.manager.Manager()), | ||
], | ||
), | ||
] |
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