-
Notifications
You must be signed in to change notification settings - Fork 265
Create ChannelVersion model with token support #5589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexVelezLl
merged 25 commits into
learningequality:unstable
from
taoerman:issue-5460-Create-ChannelVersion-model-with-token-support
Dec 19, 2025
Merged
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e4a589d
Create ChannelVersion model with token support
taoerman 66f50b7
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 31039f6
fix linting
taoerman 82dad0f
fix code
taoerman 7743900
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 50f0355
fix code
taoerman 64311a2
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 50398cf
fix code
taoerman 17c9e4c
fix code
taoerman 4819470
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 2573dcd
fix test
taoerman 3339633
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 2a4e5ef
fix bug
taoerman 54867ca
Merge branch 'issue-5460-Create-ChannelVersion-model-with-token-suppo…
taoerman 4b73ac1
fix bug
taoerman 33e0391
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] e355fb1
fix code
taoerman 9792dab
fix code
taoerman ca6856f
Merge branch 'unstable' into issue-5460-Create-ChannelVersion-model-w…
taoerman b213fd0
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 609e651
fix code
taoerman 9c1fa51
fix linting
taoerman a7c0245
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 458cc76
fix linting
taoerman a3c2798
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
294 changes: 294 additions & 0 deletions
294
contentcuration/contentcuration/migrations/0160_add_channel_version_model.py
This file contains hidden or 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,294 @@ | ||
| # Generated by Django 3.2.24 on 2025-12-03 03:00 | ||
| import uuid | ||
|
|
||
| import django.contrib.postgres.fields | ||
| import django.db.models.deletion | ||
| from django.db import migrations | ||
| from django.db import models | ||
|
|
||
| import contentcuration.models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("contentcuration", "0159_update_community_library_submission_date_updated"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="ChannelVersion", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| contentcuration.models.UUIDField( | ||
| default=uuid.uuid4, | ||
| max_length=32, | ||
| primary_key=True, | ||
| serialize=False, | ||
| ), | ||
| ), | ||
| ("version", models.PositiveIntegerField(blank=True, null=True)), | ||
| ("version_notes", models.TextField(blank=True, null=True)), | ||
| ("size", models.PositiveIntegerField(blank=True, null=True)), | ||
| ("date_published", models.DateTimeField(blank=True, null=True)), | ||
| ("resource_count", models.PositiveIntegerField(blank=True, null=True)), | ||
| ( | ||
| "kind_count", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.JSONField(), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| validators=[contentcuration.models.validate_kind_count_item], | ||
| ), | ||
| ), | ||
| ( | ||
| "included_licenses", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.IntegerField( | ||
| choices=[ | ||
| (1, "CC BY"), | ||
| (2, "CC BY-SA"), | ||
| (3, "CC BY-ND"), | ||
| (4, "CC BY-NC"), | ||
| (5, "CC BY-NC-SA"), | ||
| (6, "CC BY-NC-ND"), | ||
| (7, "All Rights Reserved"), | ||
| (8, "Public Domain"), | ||
| (9, "Special Permissions"), | ||
| ] | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "included_categories", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField( | ||
| choices=[ | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.0t5msbL5", | ||
| "d&WXdXWF.qs0Xlaxq.0t5msbL5", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.ViBlbQR&", | ||
| "d&WXdXWF.K80UMYnW.ViBlbQR&", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.nG96nHDc", | ||
| "d&WXdXWF.qs0Xlaxq.nG96nHDc", | ||
| ), | ||
| ("d&WXdXWF.5QAjgfv7", "d&WXdXWF.5QAjgfv7"), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.mjSF4QlF", | ||
| "d&WXdXWF.i1IdaNwr.mjSF4QlF", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.uErN4PdS", | ||
| "d&WXdXWF.i1IdaNwr.uErN4PdS", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.8rJ57ht6", | ||
| "d&WXdXWF.qs0Xlaxq.8rJ57ht6", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.#r5ocgid", | ||
| "d&WXdXWF.i1IdaNwr.#r5ocgid", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.F863vKiF", | ||
| "d&WXdXWF.K80UMYnW.F863vKiF", | ||
| ), | ||
| ("d&WXdXWF.e#RTW9E#", "d&WXdXWF.e#RTW9E#"), | ||
| ("PbGoe2MV.J7CU1IxN", "PbGoe2MV.J7CU1IxN"), | ||
| ("PbGoe2MV", "PbGoe2MV"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.BUMJJBnS", | ||
| "d&WXdXWF.5QAjgfv7.BUMJJBnS", | ||
| ), | ||
| ("BCG3&slG.wZ3EAedB", "BCG3&slG.wZ3EAedB"), | ||
| ("PbGoe2MV.EHcbjuKq", "PbGoe2MV.EHcbjuKq"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.XsWznP4o", | ||
| "d&WXdXWF.5QAjgfv7.XsWznP4o", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.zbDzxDE7", | ||
| "d&WXdXWF.i1IdaNwr.zbDzxDE7", | ||
| ), | ||
| ("PbGoe2MV.kyxTNsRS", "PbGoe2MV.kyxTNsRS"), | ||
| ("PbGoe2MV.tS7WKnZ7", "PbGoe2MV.tS7WKnZ7"), | ||
| ("PbGoe2MV.HGIc9sZq", "PbGoe2MV.HGIc9sZq"), | ||
| ("ziJ6PCuU", "ziJ6PCuU"), | ||
| ("BCG3&slG", "BCG3&slG"), | ||
| ("BCG3&slG.0&d0qTqS", "BCG3&slG.0&d0qTqS"), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.lb7ELcK5", | ||
| "d&WXdXWF.qs0Xlaxq.lb7ELcK5", | ||
| ), | ||
| ("ziJ6PCuU.RLfhp37t", "ziJ6PCuU.RLfhp37t"), | ||
| ("d&WXdXWF.zWtcJ&F2", "d&WXdXWF.zWtcJ&F2"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.pRvOzJTE", | ||
| "l7DsPDlm.ISEXeZt&.pRvOzJTE", | ||
| ), | ||
| ("d&WXdXWF.JDUfJNXc", "d&WXdXWF.JDUfJNXc"), | ||
| ("BCG3&slG.fP2j70bj", "BCG3&slG.fP2j70bj"), | ||
| ("ziJ6PCuU.lOBPr5ix", "ziJ6PCuU.lOBPr5ix"), | ||
| ("BCG3&slG.HLo9TbNq", "BCG3&slG.HLo9TbNq"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.DJLBbaEk", | ||
| "d&WXdXWF.kHKJ&PbV.DJLBbaEk", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.YMBXStib", | ||
| "d&WXdXWF.kHKJ&PbV.YMBXStib", | ||
| ), | ||
| ("d&WXdXWF.qs0Xlaxq", "d&WXdXWF.qs0Xlaxq"), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.8ZoaPsVW", | ||
| "d&WXdXWF.e#RTW9E#.8ZoaPsVW", | ||
| ), | ||
| ("PbGoe2MV.UOTL#KIV", "PbGoe2MV.UOTL#KIV"), | ||
| ("PbGoe2MV.d8&gCo2N", "PbGoe2MV.d8&gCo2N"), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.u0aKjT4i", | ||
| "d&WXdXWF.5QAjgfv7.u0aKjT4i", | ||
| ), | ||
| ("BCG3&slG.Tsyej9ta", "BCG3&slG.Tsyej9ta"), | ||
| ( | ||
| "d&WXdXWF.i1IdaNwr.r#wbt#jF", | ||
| "d&WXdXWF.i1IdaNwr.r#wbt#jF", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.K72&pITr", | ||
| "d&WXdXWF.K80UMYnW.K72&pITr", | ||
| ), | ||
| ("l7DsPDlm.#N2VymZo", "l7DsPDlm.#N2VymZo"), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.CfnlTDZ#", | ||
| "d&WXdXWF.e#RTW9E#.CfnlTDZ#", | ||
| ), | ||
| ("PbGoe2MV.kivAZaeX", "PbGoe2MV.kivAZaeX"), | ||
| ("d&WXdXWF.kHKJ&PbV", "d&WXdXWF.kHKJ&PbV"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.r7RxB#9t", | ||
| "d&WXdXWF.kHKJ&PbV.r7RxB#9t", | ||
| ), | ||
| ("d&WXdXWF", "d&WXdXWF"), | ||
| ("d&WXdXWF.i1IdaNwr", "d&WXdXWF.i1IdaNwr"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.&1WpYE&n", | ||
| "l7DsPDlm.ISEXeZt&.&1WpYE&n", | ||
| ), | ||
| ("d&WXdXWF.K80UMYnW", "d&WXdXWF.K80UMYnW"), | ||
| ( | ||
| "d&WXdXWF.K80UMYnW.75WBu1ZS", | ||
| "d&WXdXWF.K80UMYnW.75WBu1ZS", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.qs0Xlaxq.jNm15RLB", | ||
| "d&WXdXWF.qs0Xlaxq.jNm15RLB", | ||
| ), | ||
| ("l7DsPDlm.ISEXeZt&", "l7DsPDlm.ISEXeZt&"), | ||
| ( | ||
| "l7DsPDlm.ISEXeZt&.1JfIbP&N", | ||
| "l7DsPDlm.ISEXeZt&.1JfIbP&N", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.5QAjgfv7.4LskOFXj", | ||
| "d&WXdXWF.5QAjgfv7.4LskOFXj", | ||
| ), | ||
| ( | ||
| "d&WXdXWF.e#RTW9E#.P7s8FxQ8", | ||
| "d&WXdXWF.e#RTW9E#.P7s8FxQ8", | ||
| ), | ||
| ("l7DsPDlm", "l7DsPDlm"), | ||
| ( | ||
| "d&WXdXWF.kHKJ&PbV.KFJOCr&6", | ||
| "d&WXdXWF.kHKJ&PbV.KFJOCr&6", | ||
| ), | ||
| ], | ||
| max_length=100, | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "included_languages", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.CharField(max_length=100), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| validators=[contentcuration.models.validate_language_code], | ||
| ), | ||
| ), | ||
| ( | ||
| "non_distributable_licenses_included", | ||
| django.contrib.postgres.fields.ArrayField( | ||
| base_field=models.IntegerField( | ||
| choices=[ | ||
| (1, "CC BY"), | ||
| (2, "CC BY-SA"), | ||
| (3, "CC BY-ND"), | ||
| (4, "CC BY-NC"), | ||
| (5, "CC BY-NC-SA"), | ||
| (6, "CC BY-NC-ND"), | ||
| (7, "All Rights Reserved"), | ||
| (8, "Public Domain"), | ||
| (9, "Special Permissions"), | ||
| ] | ||
| ), | ||
| blank=True, | ||
| null=True, | ||
| size=None, | ||
| ), | ||
| ), | ||
| ( | ||
| "channel", | ||
| models.ForeignKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="channel_versions", | ||
| to="contentcuration.channel", | ||
| ), | ||
| ), | ||
| ( | ||
| "secret_token", | ||
| models.ForeignKey( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| to="contentcuration.secrettoken", | ||
| ), | ||
| ), | ||
| ( | ||
| "special_permissions_included", | ||
| models.ManyToManyField( | ||
| blank=True, | ||
| related_name="channel_versions", | ||
| to="contentcuration.AuditedSpecialPermissionsLicense", | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "unique_together": {("channel", "version")}, | ||
| }, | ||
| ), | ||
| migrations.AddField( | ||
| model_name="channel", | ||
| name="version_info", | ||
| field=models.OneToOneField( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| related_name="channel_version_info", | ||
| to="contentcuration.channelversion", | ||
| ), | ||
| ), | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that we should also update this here to use the new info (since this would directly return the
latestPublishedDataobject).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, Thanks!