# serializers.py
from rest_framework import serializers
from .models import ProductAttribute

class ProductAttributeSerializer(serializers.ModelSerializer):
    product_title = serializers.CharField(source='product.title', read_only=True)
    
    class Meta:
        model = ProductAttribute
        fields = ['id', 'product', 'product_title', 'attribute_name', 
                  'attribute_value', 'confidence_score', 'extraction_method',
                  'needs_review', 'reviewed', 'created_at']

