Skip to content

Best way to use custom LogEntry queryset for auditlog_history_view ? #792

@jpmoral-cg

Description

@jpmoral-cg

Hi, AuditlogHistoryAdminMixin.auditlog_history_view queries and displays entries like so:

def auditlog_history_view(self, request, object_id, extra_context=None):
    # stuff

    log_entries = (
        LogEntry.objects.get_for_object(obj)
        .select_related("actor")
        .order_by("-timestamp")
    )

    # other stuff

What would the best way be to use a custom queryset instead, e.g. one that include entries for child objects? I'm hoping to avoid redefining auditlog_history_view in my own admin view since I only want to change the queryset.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions