from rest_framework import serializers
from ..models import Source

class SourceSerializer(serializers.ModelSerializer):
    tags = serializers.StringRelatedField(many=True)
    added_by = serializers.StringRelatedField()

    class Meta:
        model = Source
        fields = ['id', 'title', 'url', 'archived_url', 'description', 'category', 'tags', 'added_by', 'created_at', 'updated_at']