get_deleted_objects
Find all objects related to objs that should also be deleted. objs
must be a homogeneous iterable of objects (e.g. a QuerySet).
Return a nested list of strings suitable for display in the
template with the ``unordered_list``
and ``truncated_unordered_list`` filters.
def get_deleted_objects(
objs: iterable,
request: HttpRequest,
admin_site: AdminSite
) - > tuple
Find all objects related to objs that should also be deleted. objs must be a homogeneous iterable of objects (e.g. a QuerySet).
Parameters
| Name | Type | Description |
|---|---|---|
| objs | iterable | A homogeneous collection of Django model instances (typically a QuerySet) to be evaluated for deletion. |
| request | HttpRequest | The current HTTP request object used to verify user permissions for deleting related objects. |
| admin_site | AdminSite | The Django AdminSite instance used to check model registration and generate administrative URLs for the objects. |
Returns
| Type | Description |
|---|---|
tuple | A four-item tuple containing: a nested list of formatted strings for display, a dictionary mapping model names to counts of objects to be deleted, a set of verbose model names for which the user lacks delete permissions, and a list of strings representing protected objects that cannot be deleted. |