KnownMIMEType

class bootlace.forms.fields.KnownMIMEType(message: str | None = None)[source]

Bases: object

Validator that ensures that a content-type field is a known MIME type

Methods Summary

__call__(form, field)

Validates the field

Methods Documentation

__call__(form: Any, field: Field) None[source]

Validates the field

Parameters:
  • form – The form contianing the field

  • field – The field

Raises:

ValidationError – If the field is not a known MIME type