mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-29 00:35:45 +08:00
Further polishing for subjects
This commit is contained in:
parent
de1dabf53c
commit
492a605557
28 changed files with 225 additions and 151 deletions
|
@ -1,6 +1,7 @@
|
|||
# Generated by Django 4.2.2 on 2023-06-27 05:57
|
||||
# Generated by Django 4.2.2 on 2023-06-27 09:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
@ -15,8 +16,15 @@ class Migration(migrations.Migration):
|
|||
name='Course',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('course_name', models.CharField(max_length=64)),
|
||||
('course_shortname', models.CharField(max_length=16)),
|
||||
('name', models.CharField(max_length=64)),
|
||||
('shortname', models.CharField(max_length=16)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubjectCourse',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='courses.course')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
|
27
stude/courses/migrations/0002_initial.py
Normal file
27
stude/courses/migrations/0002_initial.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 4.2.2 on 2023-06-27 09:44
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('courses', '0001_initial'),
|
||||
('subjects', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='subjectcourse',
|
||||
name='subject',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.subject'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='course',
|
||||
name='subjects',
|
||||
field=models.ManyToManyField(related_name='SubjectCourse_course', through='courses.SubjectCourse', to='subjects.subject'),
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 4.2.2 on 2023-06-27 07:31
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('courses', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='course',
|
||||
old_name='course_name',
|
||||
new_name='name',
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='course',
|
||||
old_name='course_shortname',
|
||||
new_name='shortname',
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue