Registry Module

Contains collection of models that have been registered to have signals dispatched for. Also contains helper functions relating to the registry.

action_triggers.registry.add_to_registry(model: Model | Type[Model]) None[source]

Adds a model to the registry.

Parameters:

model (Union[Model, Type[Model]]) – The model to add to the registry.

Returns:

None

action_triggers.registry.model_in_registry(model: Model | Type[Model]) bool[source]

Checks if a model is in the registry.

Parameters:

model (Union[Model, Type[Model]]) – The model to check.

Returns:

True if the model is in the registry, False otherwise.

Return type:

bool

action_triggers.registry.model_str(model: Model | Type[Model]) str[source]

Returns a string representation of the model which can be used to identify both the app label and the model name.

Parameters:

model (Union[Model, Type[Model]]) – The model to get the string representation of.

Returns:

A string representation of the model.

Return type:

str

action_triggers.registry.registered_content_types() QuerySet[source]

Return a queryset of all the content types registered in the registry.

Returns:

A queryset of all the content types registered in the registry.

Return type:

QuerySet[ContentType]