Major overhaul to subject model and serializers

This commit is contained in:
Keannu Christian Bernasol 2023-07-26 23:32:03 +08:00
parent 0eff07a1ae
commit 0fd790505e
26 changed files with 199 additions and 173 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 4.2.3 on 2023-07-26 03:53
# Generated by Django 4.2.3 on 2023-07-26 12:06
import django.contrib.gis.db.models.fields
from django.db import migrations, models
@ -10,8 +10,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('student_status', '0001_initial'),
('subjects', '0001_initial'),
('student_status', '0001_initial'),
]
operations = [

View file

@ -4,7 +4,7 @@ from rest_framework.exceptions import PermissionDenied
from rest_framework.permissions import IsAuthenticated
from .serializers import StudyGroupSerializer
from .models import StudyGroup
from subjects.models import SubjectInstance
from subjects.models import Subject
# Create your views here.
@ -26,7 +26,7 @@ class StudyGroupListView(generics.ListAPIView):
print(user_course)
# Get subject names related to the user's course
subject_names = SubjectInstance.objects.filter(
subject_names = Subject.objects.filter(
course=user_course
).values_list('subject', flat=True)