|
@@ -2749,6 +2749,65 @@ The presence of the ``admin_password_reset`` named URL will cause a "forgotten
|
|
|
your password?" link to appear on the default admin log-in page under the
|
|
|
password box.
|
|
|
|
|
|
+``LogEntry`` objects
|
|
|
+====================
|
|
|
+
|
|
|
+.. class:: models.LogEntry
|
|
|
+
|
|
|
+ The ``LogEntry`` class tracks additions, changes, and deletions of objects
|
|
|
+ done through the admin interface.
|
|
|
+
|
|
|
+.. currentmodule:: django.contrib.admin.models
|
|
|
+
|
|
|
+``LogEntry`` attributes
|
|
|
+-----------------------
|
|
|
+
|
|
|
+.. attribute:: LogEntry.action_time
|
|
|
+
|
|
|
+ The date and time of the action.
|
|
|
+
|
|
|
+.. attribute:: LogEntry.user
|
|
|
+
|
|
|
+ The user (an :setting:`AUTH_USER_MODEL` instance) who performed the
|
|
|
+ action.
|
|
|
+
|
|
|
+.. attribute:: LogEntry.content_type
|
|
|
+
|
|
|
+ The :class:`~django.contrib.contenttypes.models.ContentType` of the
|
|
|
+ modified object.
|
|
|
+
|
|
|
+.. attribute:: LogEntry.object_id
|
|
|
+
|
|
|
+ The textual representation of the modified object's primary key.
|
|
|
+
|
|
|
+.. attribute:: LogEntry.object_repr
|
|
|
+
|
|
|
+ The object`s ``repr()`` after the modification.
|
|
|
+
|
|
|
+.. attribute:: LogEntry.action_flag
|
|
|
+
|
|
|
+ The type of action logged: ``ADDITION``, ``CHANGE``, ``DELETION``.
|
|
|
+
|
|
|
+ For example, to get a list of all additions done through the admin::
|
|
|
+
|
|
|
+ from django.contrib.admin.models import LogEntry, ADDITION
|
|
|
+
|
|
|
+ LogEntry.objects.filter(action_flag=ADDITION)
|
|
|
+
|
|
|
+.. attribute:: LogEntry.change_message
|
|
|
+
|
|
|
+ The detailed description of the modification. In the case of an edit, for
|
|
|
+ example, the message contains a list of the edited fields.
|
|
|
+
|
|
|
+``LogEntry`` methods
|
|
|
+--------------------
|
|
|
+
|
|
|
+.. method:: LogEntry.get_edited_object()
|
|
|
+
|
|
|
+ A shortcut that returns the referenced object.
|
|
|
+
|
|
|
+.. currentmodule:: django.contrib.admin
|
|
|
+
|
|
|
.. _admin-reverse-urls:
|
|
|
|
|
|
Reversing admin URLs
|