Automatically add subjects based on a .csv file

This commit is contained in:
Keannu Christian Bernasol 2023-07-18 20:25:03 +08:00
parent c10ef2d784
commit 33e8218e51
8 changed files with 225 additions and 14 deletions

View file

@ -0,0 +1,23 @@
# Generated by Django 4.2.3 on 2023-07-18 10:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0002_initial'),
]
operations = [
migrations.AlterField(
model_name='course',
name='name',
field=models.CharField(max_length=64, unique=True),
),
migrations.AlterField(
model_name='course',
name='shortname',
field=models.CharField(max_length=16, unique=True),
),
]

View file

@ -5,8 +5,8 @@ from django.db import models
class Course(models.Model):
name = models.CharField(max_length=64)
shortname = models.CharField(max_length=16)
name = models.CharField(max_length=64, unique=True)
shortname = models.CharField(max_length=16, unique=True)
subjects = models.ManyToManyField(
'subjects.Subject', related_name='SubjectCourse_course', through='subjects.SubjectCourse')