kopia lustrzana https://github.com/longclawshop/longclaw
20 wiersze
573 B
Python
20 wiersze
573 B
Python
from rest_framework import serializers
|
|
|
|
from longclaw.longclawshipping.models import Address, ShippingRate, Country
|
|
|
|
class AddressSerializer(serializers.ModelSerializer):
|
|
country = serializers.PrimaryKeyRelatedField(queryset=Country.objects.all())
|
|
class Meta:
|
|
model = Address
|
|
fields = "__all__"
|
|
|
|
class ShippingRateSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = ShippingRate
|
|
fields = "__all__"
|
|
|
|
class CountrySerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Country
|
|
fields = "__all__"
|