Rest — Django Building Blocks documentation

# Rest

Contents

- Rest

  - Serializers

## Serializers

class building_blocks.rest.serializers.NameSlugSerializer(*args, **kwargs)

  Bases: `ModelSerializer`

  Serializer for NameSlug

class building_blocks.rest.serializers.HasUUIDSerializer(*args, **kwargs)

  Bases: `ModelSerializer`

  Serializer for HasUUID

class building_blocks.rest.serializers.SluggedKaosModelSerializer(*args, **kwargs)

  Bases: `ModelSerializer`

  Serializer for SluggedKaosModel

class building_blocks.rest.serializers.CurrentProfileDefault(profile_cls)

  Bases: `CurrentUserDefault`

  Rest serializer field to set default value for a profile field, if the user has the profile

  Example:

        >>> class MyModelSerializer(serializers.Serializer):
        >>>     profile = UserProfileSerializer(default=CurrentProfileDefault(UserProfile))