plugins_api.utils.level_from_plugin
Functions
| Name | Description |
|---|---|
resolve_field_level_by_plugin_slug | Resolve the most restrictive level of a plugin field by scanning all MetadataObjectTypes. |
resolve_field_level_in_metadata_object | Resolve the level of a plugin field within a specific MetadataObjectType. |
resolve_field_level_by_plugin_slugfunction#
def resolve_field_level_by_plugin_slug(field_slug: str, source: str) -> str | NoneResolve the most restrictive level of a plugin field by scanning all MetadataObjectTypes.
Useful when only the plugin slug is available (e.g. from a serializer context or a DB source name), without a direct reference to the plugin class or a specific metadata object instance.
The most restrictive level wins across all object types:
mandatory (0) > recommended (1) > optional (2).
Parameters
resolve_field_level_in_metadata_objectfunction#
def resolve_field_level_in_metadata_object(plugin_class, metadata_object, field_slug: str, metadata_object_types: dict | None = None) -> str | NoneResolve the level of a plugin field within a specific MetadataObjectType.
Useful in contexts where both the plugin class and the metadata object are already available (e.g. during submission validation or promotion), avoiding a full scan across all object types.
Parameters

