from core.models.tag import Tag
from rest_framework import serializers


class TagSerializer(serializers.ModelSerializer):
    user = serializers.SlugRelatedField(slug_field='username')
    description = serializers.CharField(required=False)

    class Meta:
        model = Tag
from core.models.tag import Tag
from core.models import AtmosphereUser
from rest_framework import serializers


class TagSerializer(serializers.ModelSerializer):
    user = serializers.SlugRelatedField(slug_field='username', queryset=AtmosphereUser.objects.all())
    description = serializers.CharField(required=False)

    class Meta:
        model = Tag
upgrade TagSerializer to DRF3