Blame view

src/core/pyros_django/api/serializers.py 470 Bytes
98621b46   Alexis Koralewski   add DRF, pyros ap...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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__"