DRF Serializers

Serializer for the Secret model in the Smarter API.

This serializer exposes all fields of the Secret model, including related user profile information. Use it for endpoints that require secure credential or secret management.

param id:

Integer. Unique identifier for the secret.

param name:

String. Name of the secret.

param description:

String. Description of the secret.

param last_accessed:

DateTime. Timestamp of last access.

param expires_at:

DateTime. Expiration timestamp.

param user_profile:

Instance of UserProfileSerializer. Associated user profile.

Note

All fields are read-only in this serializer.

Example usage:

from smarter.apps.account.serializers import SecretSerializer
serializer = SecretSerializer(secret_instance)
data = serializer.data

See also

For user profile details, see UserProfileSerializer.