from rest_framework import serializers
from .models import Category, Product


class CategorySerializer(serializers.ModelSerializer):


    class Meta:
        model = Category
        fields = ['name', 'slug']


class ProductSerializer(serializers.ModelSerializer):


    class Meta:
        model = Product
        fields = ['id', 'category', 'name', 'image', 'description', 'price']

38ec43495fc5edf5a1ac46116575028e79b12347
<mask token>

<mask token>


class ProductSerializer(serializers.ModelSerializer):


    class Meta:
        model = Product
        fields = ['id', 'category', 'name', 'image', 'description', 'price']

<mask token>


class CategorySerializer(serializers.ModelSerializer):


    class Meta:
        model = Category
        fields = ['name', 'slug']


class ProductSerializer(serializers.ModelSerializer):


    class Meta:
        model = Product
        fields = ['id', 'category', 'name', 'image', 'description', 'price']

from rest_framework import serializers
from .models import Category, Product


class CategorySerializer(serializers.ModelSerializer):


    class Meta:
        model = Category
        fields = ['name', 'slug']


class ProductSerializer(serializers.ModelSerializer):


    class Meta:
        model = Product
        fields = ['id', 'category', 'name', 'image', 'description', 'price']
