from rest_framework import serializers
from ..models import Suggestion

class SuggestionSerializer(serializers.ModelSerializer):
    suggested_by = serializers.StringRelatedField()

    class Meta:
        model = Suggestion
        fields = ['id', 'url', 'description', 'suggested_by', 'created_at', 'is_approved']
        read_only_fields = ['suggested_by', 'is_approved']