InfoTech-Backend/infotech/subjects/serializers.py

14 lines
399 B
Python
Raw Normal View History

2023-03-21 21:22:14 +08:00
from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Subject
from students.models import Student
2023-03-21 21:22:14 +08:00
class SubjectSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Subject
2023-04-22 11:00:40 +08:00
fields = ('id', 'name', 'code',
'max_slots', 'year_level', 'semester')
read_only_fields = ['id']