from __future__ import annotations
[docs]
class DuplicateLabelError(FormError):
def __init__(self, label: str):
[docs]
def __repr__(self) -> str:
return f"DuplicateLabelError(label='{self.label}')"
[docs]
class InvalidMimeType(FormError):
pass
[docs]
class UnableToComplete(FormError):
pass
[docs]
class InvalidIndentSyntax(FormError):
def __init__(self, line: int):
[docs]
class EmptyFieldsetError(FormError):
def __init__(self, field_name: str):
[docs]
self.field_name = field_name
[docs]
class FieldCompileError(FormError):
def __init__(self, field_name: str):
[docs]
self.field_name = field_name
[docs]
class MixedTypeError(FormError):
def __init__(self, field_name: str):
[docs]
self.field_name = field_name
[docs]
class RequiredFieldAddedError(FormError):
"""
Directory Migration: A added field cannot be required at first one
directory entries exist. Make it mandatory in a separate migration step.
"""
def __init__(self, field_names: list[str], *args: object) -> None:
super().__init__(*args)
[docs]
self.field_names = field_names