1from rest_framework import serializers
2
3class PostSerializer(serializers.ModelSerializer):
4 user = serializers.PrimaryKeyRelatedField(read_only=True, default=serializers.CurrentUserDefault())
5 class Meta:
6 model = Post
1class AccountSerializer(serializers.ModelSerializer):
2 class Meta:
3 model = Account
4 fields = ['id', 'account_name', 'users', 'created']