serializers.py
470 Bytes
from common.models import PyrosUser, Sequence
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = PyrosUser
fields = ['url', 'username', 'email', 'institute', "user_level", "motive_of_registration"]
depth = 1
class SequenceSerializer(serializers.ModelSerializer):
pyros_user = UserSerializer(read_only=True)
class Meta:
model = Sequence
fields = "__all__"