mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-28 16:25:44 +08:00
Automatically add subjects based on a .csv file
This commit is contained in:
parent
c10ef2d784
commit
33e8218e51
8 changed files with 225 additions and 14 deletions
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue