from rest_framework import serializers
from students.models import User, SSTCard
from app_api.serializers import UserSerializer
from .course_serializers import EnrollmentP2Serializer
from .quiz_serializers import TakenQuizSerializer, StudentAnswerSerializer


class SSTCardSerializer(serializers.ModelSerializer):


    class Meta:
        model = SSTCard
        fields = ['card_id', 'card_type', 'qr_code', 'renew_status',
            'issued', 'expired']

    def to_representation(self, instance):
        self.fields['student'] = UserSerializer(read_only=True)
        return super(SSTCardSerializer, self).to_representation(instance)

bbb572f5091f930cb359b99f05611fa385b2b0de
<mask token>

<mask token>


class SSTCardSerializer(serializers.ModelSerializer):


    class Meta:
        model = SSTCard
        fields = ['card_id', 'card_type', 'qr_code', 'renew_status',
            'issued', 'expired']
    <mask token>

<mask token>


class SSTCardSerializer(serializers.ModelSerializer):


    class Meta:
        model = SSTCard
        fields = ['card_id', 'card_type', 'qr_code', 'renew_status',
            'issued', 'expired']

    def to_representation(self, instance):
        self.fields['student'] = UserSerializer(read_only=True)
        return super(SSTCardSerializer, self).to_representation(instance)

from rest_framework import serializers
from students.models import User, SSTCard
from app_api.serializers import UserSerializer
from .course_serializers import EnrollmentP2Serializer
from .quiz_serializers import TakenQuizSerializer, StudentAnswerSerializer


class SSTCardSerializer(serializers.ModelSerializer):


    class Meta:
        model = SSTCard
        fields = ['card_id', 'card_type', 'qr_code', 'renew_status',
            'issued', 'expired']

    def to_representation(self, instance):
        self.fields['student'] = UserSerializer(read_only=True)
        return super(SSTCardSerializer, self).to_representation(instance)
