DRF Serializers

Guardrail serializers.

class smarter.apps.guardrail.serializers.GuardrailEventSerializer(*args, **kwargs)[source]

Bases: ModelSerializer

Serializer for the smarter.apps.guardrail.models.GuardrailEvent model.

Only reviewed is writable.

class smarter.apps.guardrail.serializers.GuardrailSerializer(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModelSerializer

Serializer for the smarter.apps.guardrail.models.Guardrail model.

All fields are read only.

get_fields()[source]

Return the dict of field names -> field instances that should be used for self.fields when instantiating the serializer.

get_manifest_url(obj)[source]

The URL of the Guardrail’s detail view, which renders its manifest.

Return type:

str