kopia lustrzana https://github.com/longclawshop/longclaw
18 wiersze
437 B
Python
18 wiersze
437 B
Python
from rest_framework import serializers
|
|
from longclaw.utils import ProductVariant, maybe_get_product_model
|
|
|
|
class ProductSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
model = maybe_get_product_model()
|
|
fields = "__all__"
|
|
|
|
|
|
class ProductVariantSerializer(serializers.ModelSerializer):
|
|
|
|
product = ProductSerializer()
|
|
|
|
class Meta:
|
|
model = ProductVariant
|
|
fields = "__all__"
|