<reponame>Um9i/ERPv
from rest_framework import serializers
from .models import Supplier, SupplierProduct


class SupplierSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Supplier
        fields = [
            "url",
            "id",
            "name",
            "address",
            "postcode",
            "phone",
            "email",
            "website",
        ]


class SupplierProductSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = SupplierProduct
        fields = ["url", "id", "supplier", "product", "name", "cost", "on_order"]

from rest_framework import serializers
from .models import Supplier, SupplierProduct


class SupplierSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Supplier
        fields = [
            "url",
            "id",
            "name",
            "address",
            "postcode",
            "phone",
            "email",
            "website",
        ]


class SupplierProductSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = SupplierProduct
        fields = ["url", "id", "supplier", "product", "name", "cost", "on_order"]