model
django_spire.core.components.confirmation.model
__all__ = ['BaseModelActionConfirmationComponent', 'BaseModelDeleteConfirmationComponent', 'ModelDeleteConfirmationComponent', 'ModelSetDeletedConfirmationComponent']
module-attribute
BaseModelActionConfirmationComponent
Bases: BaseConfirmationComponent, ABC
A :class:BaseConfirmationComponent for one action on one model row.
Built with the row, as instance=, it works for any model. Confirming
performs the action with perform_action(), which a subclass writes,
and fires confirmed with the row's pk.
model_name
property
instance
get_permission_model
Return the row's model, whose permissions Glue.ModelAccessMixin reads.
perform_action
abstractmethod
BaseModelDeleteConfirmationComponent
Bases: BaseModelActionConfirmationComponent, ABC
A :class:BaseModelActionConfirmationComponent worded and guarded as a
delete: confirming needs DELETE access, and title, message and
confirm_label name the row and its model when left unset.
A subclass deletes the row in perform_action().
template = 'django_spire/component/confirmation/model_delete_confirmation.html'
class-attribute
instance-attribute
confirm_access = Glue.Access.DELETE
class-attribute
instance-attribute
ModelDeleteConfirmationComponent
Bases: BaseModelDeleteConfirmationComponent
Deletes the row from the database, with the model's delete().
ModelSetDeletedConfirmationComponent
Bases: BaseModelDeleteConfirmationComponent
Soft-deletes the row, with the set_deleted() of Spire's history mixin.