1234567891011121314151617181920 |
- from rest_framework import serializers
- from content.models import Author
- class AuthorRelationSerializer(serializers.ModelSerializer):
- class Meta:
- model = Author
- fields = ["id", "uuid", "name", ]
- read_only_fields = ["uuid", ]
- class AuthorSerializer(serializers.ModelSerializer):
- class Meta:
- model = Author
- fields = ["id", "uuid", "name", "avatar",]
- read_only_fields = ["uuid", ]
|