Beispiel #1
0
class LikeSerializer(serializers.ModelSerializer):

    user = UserSerializerForLike(source='cached_user')

    class Meta:
        model = Like
        fields = ('id', 'user', 'created_at', 'content_type', 'object_id')
Beispiel #2
0
class LikeSerializer(serializers.ModelSerializer):
    # cached_user will be defined in like model
    user = UserSerializerForLike(source='cached_user')

    class Meta:
        model = Like
        fields = ('user', 'created_at')
Beispiel #3
0
class LikeSerializer(serializers.ModelSerializer):
    user = UserSerializerForLike(source='cached_user')

    class Meta:
        model = Like
        fields = ('user', 'created_at')