mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-29 00:35:45 +08:00
Improved subjects model and serializer
This commit is contained in:
parent
3748b4d2c8
commit
3f136f8cef
4 changed files with 84 additions and 11 deletions
|
@ -0,0 +1,29 @@
|
|||
# Generated by Django 4.2.3 on 2023-07-19 07:04
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('subjects', '0002_alter_subject_code_alter_subject_name_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SubjectCode',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(max_length=16, unique=True)),
|
||||
],
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='subject',
|
||||
name='code',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='subject',
|
||||
name='code',
|
||||
field=models.ManyToManyField(to='subjects.subjectcode'),
|
||||
),
|
||||
]
|
18
stude/subjects/migrations/0004_rename_code_subject_codes.py
Normal file
18
stude/subjects/migrations/0004_rename_code_subject_codes.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 4.2.3 on 2023-07-19 07:09
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('subjects', '0003_subjectcode_remove_subject_code_subject_code'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='subject',
|
||||
old_name='code',
|
||||
new_name='codes',
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue