mirror of
https://github.com/lemeow125/InfoTech-Backend.git
synced 2024-11-16 22:19:25 +08:00
14 lines
503 B
Python
14 lines
503 B
Python
from rest_framework import serializers
|
|
from .models import Professor
|
|
from subjects.models import Subject
|
|
|
|
|
|
class ProfessorSerializer(serializers.HyperlinkedModelSerializer):
|
|
date_joined = serializers.DateTimeField(
|
|
format="%d-%m-%Y %I:%M%p", read_only=True)
|
|
|
|
class Meta:
|
|
model = Professor
|
|
fields = ('id', 'full_name', 'first_name',
|
|
'last_name', 'age', 'gender', 'date_joined')
|
|
read_only_fields = ('id', 'date_joined', 'full_name')
|