ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

Ensure an uploaded file declares one of the accepted MIME types.

Wildcard subtypes such as "image/*" match every subtype of the given top-level type.

Method __init__ Initialize the rule with the accepted MIME types.
Method enforce Validate an uploaded file against the accepted MIME types.
Class Variable __code__ Undocumented
Class Variable __message__ Undocumented
Class Variable __slots__ Undocumented
Instance Variable _exact Undocumented
Instance Variable _prefixes Undocumented

Inherited from Rule:

Async Method enforceAsync Run an explicitly asynchronous rule check without blocking the loop.
Method validate Validate the field value and return a failure when invalid.
Async Method validateAsync Await the rule and describe an invalid field value.
Instance Variable _code Undocumented
Instance Variable _message Undocumented
def __init__(self, *mime_types: str, message: str | None = None): (source)

Initialize the rule with the accepted MIME types.

Parameters
*mime_types:strMIME types the file may declare, optionally using a wildcard subtype. At least one is required.
message:str | None, optionalOverride message used when validation fails.
Returns
NoneThis method initializes the instance and returns None.
Raises
ValueErrorIf no MIME type is supplied.
def enforce(self, field: str, value: object, instance: object) -> bool: (source)

Validate an uploaded file against the accepted MIME types.

Parameters
field:strField name associated with the value.
value:objectValue to validate.
instance:objectOwning object instance. This argument is accepted for interface compatibility.
Returns
boolReturn True when the value passes validation.
__code__: str = (source)

Undocumented

__message__: str = (source)

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented

_prefixes: tuple[str, ...] = (source)

Undocumented