mirror of
https://github.com/django/django.git
synced 2025-11-22 20:16:24 +00:00
Refs #34462 -- Removed ModelAdmin.log_deletion() and LogEntryManager.log_action() per deprecation timeline.
This commit is contained in:
parent
817bc5800b
commit
6c120508b6
6 changed files with 4 additions and 240 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from django.contrib import admin
|
||||
from django.contrib.admin.models import LogEntry, LogEntryManager
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
|
@ -87,26 +86,3 @@ class VehicleMixin(Vehicle):
|
|||
|
||||
class Car(VehicleMixin):
|
||||
pass
|
||||
|
||||
|
||||
class InheritedLogEntryManager(LogEntryManager):
|
||||
model = LogEntry
|
||||
|
||||
def log_action(
|
||||
self,
|
||||
user_id,
|
||||
content_type_id,
|
||||
object_id,
|
||||
object_repr,
|
||||
action_flag,
|
||||
change_message="",
|
||||
):
|
||||
return LogEntry.objects.create(
|
||||
user_id=user_id,
|
||||
content_type_id=content_type_id,
|
||||
object_id=str(object_id),
|
||||
# Changing actual repr to test repr
|
||||
object_repr="Test Repr",
|
||||
action_flag=action_flag,
|
||||
change_message=change_message,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue