forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [AXM-1387] save block size to model
- Loading branch information
Showing
7 changed files
with
97 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
Offline mode admin configuration. | ||
""" | ||
from django.contrib import admin | ||
|
||
from .models import OfflineBlockSize | ||
|
||
|
||
class OfflineBlockSizeAdmin(admin.ModelAdmin): | ||
""" | ||
OfflineBlockSize admin configuration. | ||
""" | ||
list_display = ( | ||
"course_id", | ||
"block_location", | ||
"size", | ||
) | ||
search_fields = ( | ||
"course_id", | ||
"block_location", | ||
) | ||
list_filter = ("course_id",) | ||
|
||
|
||
admin.site.register(OfflineBlockSize, OfflineBlockSizeAdmin) |
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,24 @@ | ||
# Generated by Django 4.2.18 on 2025-02-10 16:20 | ||
|
||
from django.db import migrations, models | ||
import opaque_keys.edx.django.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='OfflineBlockSize', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('course_id', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)), | ||
('block_location', opaque_keys.edx.django.models.UsageKeyField(max_length=255)), | ||
('size', models.PositiveIntegerField(default=0)), | ||
], | ||
), | ||
] |
Empty file.
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,15 @@ | ||
""" | ||
Offline mode models. | ||
""" | ||
from django.db import models | ||
from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField | ||
|
||
|
||
class OfflineBlockSize(models.Model): | ||
""" | ||
Model to store the block size for offline content. | ||
""" | ||
|
||
course_id = CourseKeyField(max_length=255, db_index=True) | ||
block_location = UsageKeyField(blank=False, max_length=255) | ||
size = models.PositiveIntegerField(default=0) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Offline mode utils. | ||
""" | ||
import logging | ||
|
||
|