diff --git a/infotech/students/migrations/0012_alter_student_schedules.py b/infotech/students/migrations/0012_alter_student_schedules.py new file mode 100644 index 0000000..740dd09 --- /dev/null +++ b/infotech/students/migrations/0012_alter_student_schedules.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2 on 2023-04-22 08:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('schedules', '0007_schedule_semester'), + ('students', '0011_student_schedules'), + ] + + operations = [ + migrations.AlterField( + model_name='student', + name='schedules', + field=models.ManyToManyField(null=True, related_name='StudentSchedule_subject', through='schedules.StudentSchedule', to='schedules.schedule'), + ), + ] diff --git a/infotech/students/serializers.py b/infotech/students/serializers.py index a45f88e..49a1368 100644 --- a/infotech/students/serializers.py +++ b/infotech/students/serializers.py @@ -8,7 +8,7 @@ from subjects.models import Subject class StudentSerializer(serializers.HyperlinkedModelSerializer): schedules = serializers.SlugRelatedField( - queryset=Subject.objects.all(), many=True, slug_field='name', allow_null=True) + queryset=Subject.objects.all(), many=True, slug_field='name', allow_null=True, required=False) class Meta: model = Student