Skip to content

Commit b1fbf57

Browse files
committed
feat: Update settings and make migrations.
1 parent 105b772 commit b1fbf57

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

backend/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ docs/sample_plugin.*.rst
6363
# Private requirements
6464
requirements/private.in
6565
requirements/private.txt
66+
67+
# Test cruft
68+
default.db

backend/sample_plugin/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ class SamplePluginConfig(AppConfig):
99
"""
1010
Configuration for the sample_plugin Django application.
1111
"""
12-
12+
default_auto_field = 'django.db.models.BigAutoField'
1313
name = 'sample_plugin'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 4.2.20 on 2025-04-14 12:39
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import opaque_keys.edx.django.models
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='CourseArchiveStatus',
20+
fields=[
21+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22+
('course_id', opaque_keys.edx.django.models.CourseKeyField(db_index=True, help_text='The unique identifier for the course.', max_length=255)),
23+
('is_archived', models.BooleanField(db_index=True, default=False, help_text='Whether the course is archived.')),
24+
('archive_date', models.DateTimeField(blank=True, help_text='The date and time when the course was archived.', null=True)),
25+
('created_at', models.DateTimeField(auto_now_add=True)),
26+
('updated_at', models.DateTimeField(auto_now=True)),
27+
('user', models.ForeignKey(help_text='The user who this archive status is for.', on_delete=django.db.models.deletion.CASCADE, related_name='course_archive_statuses', to=settings.AUTH_USER_MODEL)),
28+
],
29+
options={
30+
'verbose_name': 'Course Archive Status',
31+
'verbose_name_plural': 'Course Archive Statuses',
32+
'ordering': ['-updated_at'],
33+
},
34+
),
35+
migrations.AddConstraint(
36+
model_name='coursearchivestatus',
37+
constraint=models.UniqueConstraint(fields=('course_id', 'user'), name='unique_user_course_archive_status'),
38+
),
39+
]

backend/sample_plugin/migrations/__init__.py

Whitespace-only changes.

backend/test_settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def root(*args):
5757
'OPTIONS': {
5858
'context_processors': [
5959
'django.contrib.auth.context_processors.auth', # this is required for admin
60+
'django.template.context_processors.request', # this is also required for admin navigation sidebar
6061
'django.contrib.messages.context_processors.messages', # this is required for admin
6162
],
6263
},

0 commit comments

Comments
 (0)