summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 35c787ec1b..f6ed8f8e13 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -2823,7 +2823,18 @@ password box.
.. 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.
+ example, the message contains a list of the edited fields. The Django admin
+ site formats this content as a JSON structure, so that
+ :meth:`get_change_message` can recompose a message translated in the current
+ user language. Custom code might set this as a plain string though. You are
+ advised to use the :meth:`get_change_message` method to retrieve this value
+ instead of accessing it directly.
+
+ .. versionchanged:: 1.10
+
+ Previously, this attribute was always a plain string. It is
+ now JSON-structured so that the message can be translated in the current
+ user language. Old messages are untouched.
``LogEntry`` methods
--------------------
@@ -2832,6 +2843,14 @@ password box.
A shortcut that returns the referenced object.
+.. method:: LogEntry.get_change_message()
+
+ .. versionadded:: 1.10
+
+ Formats and translates :attr:`change_message` into the current user
+ language. Messages created before Django 1.10 will always be displayed in
+ the language in which they were logged.
+
.. currentmodule:: django.contrib.admin
.. _admin-reverse-urls: