mirror of
https://github.com/lemeow125/InfoTech-Backend.git
synced 2025-05-16 11:28:14 +08:00
Remove shedules field on students
This commit is contained in:
parent
c9c7d1f5ec
commit
98392344a1
8 changed files with 95 additions and 9 deletions
19
infotech/students/migrations/0006_student_schedules.py
Normal file
19
infotech/students/migrations/0006_student_schedules.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 4.2 on 2023-04-22 03:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('schedules', '0002_alter_schedule_professor'),
|
||||
('students', '0005_remove_student_enrolled_subjects'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='student',
|
||||
name='schedules',
|
||||
field=models.ManyToManyField(through='schedules.StudentSchedule', to='schedules.schedule'),
|
||||
),
|
||||
]
|
19
infotech/students/migrations/0007_alter_student_schedules.py
Normal file
19
infotech/students/migrations/0007_alter_student_schedules.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 4.2 on 2023-04-22 03:24
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('schedules', '0002_alter_schedule_professor'),
|
||||
('students', '0006_student_schedules'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='student',
|
||||
name='schedules',
|
||||
field=models.ManyToManyField(related_name='Schedule_subject', through='schedules.StudentSchedule', to='schedules.schedule'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 4.2 on 2023-04-22 03:58
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('students', '0007_alter_student_schedules'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='student',
|
||||
name='schedules',
|
||||
),
|
||||
]
|
|
@ -36,15 +36,15 @@ class Student(models.Model):
|
|||
clearance_done = models.BooleanField()
|
||||
pta_done = models.BooleanField()
|
||||
#
|
||||
# enrolled_subjects = models.ManyToManyField(
|
||||
# 'subjects.Subject', through='subjects.SubjectStudent')
|
||||
# schedules = models.ManyToManyField(
|
||||
# 'schedules.Schedule', related_name='StudentSchedule_subject', through='schedules.StudentSchedule')
|
||||
year_level = models.CharField(max_length=20, choices=YearLevels.choices)
|
||||
current_semester = models.CharField(
|
||||
max_length=20, choices=Semesters.choices, default=Semesters.FIRST_SEM)
|
||||
|
||||
def __str__(self):
|
||||
return self.first_name
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
return self.first_name + " " + self.middle_name + " " + self.last_name
|
||||
return f"{self.first_name} {self.last_name}"
|
||||
|
||||
def __str__(self):
|
||||
return self.full_name
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from rest_framework import serializers
|
||||
from django.contrib.auth.models import User
|
||||
from .models import Student
|
||||
from subjects.models import Subject
|
||||
from schedules.models import Schedule
|
||||
|
||||
|
||||
class StudentSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue