mirror of
https://github.com/lemeow125/InfoTech-Backend.git
synced 2024-11-17 06:29:26 +08:00
15 lines
477 B
Python
15 lines
477 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', 'first_name',
|
||
|
'last_name', 'age', 'gender', 'date_joined')
|
||
|
read_only_fields = ('id', 'date_joined')
|