File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,21 @@ inheriting from them to have historical tracking as well.
98
98
99
99
Recording Which User Changed a Model
100
100
------------------------------------
101
+ There are three documented ways to attach users to a tracked change:
102
+
103
+ 1. Use the middleware as described in :doc: `/usage `. The middleware sets the
104
+ User instance that made the request as the ``history_user `` on the history
105
+ table.
106
+
107
+ 2. Use ``simple_history.admin.SimpleHistoryAdmin`. Under the hood,
108
+ ``SimpleHistoryAdmin `` actually sets the ``_history_user `` on the object to
109
+ attach the user to the tracked change by overriding the `save_model ` method.
110
+
111
+ 3. Assign a user to the ``_history_user `` attribute of the object as described
112
+ below:
113
+
114
+ Using ``_history_user `` to Record Which User Changed a Model
115
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
116
102
117
To denote which user changed a model, assign a ``_history_user `` attribute on
103
118
your model.
You can’t perform that action at this time.
0 commit comments