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