@@ -151,10 +151,10 @@ As an example using the callable mechanism, the below changes the default prefix
151
151
opinion = models.CharField(max_length = 2000 )
152
152
153
153
register(Opinion, custom_model_name = lambda x :f ' Audit { x} ' )
154
-
154
+
155
155
The resulting history class names would be `AuditPoll ` and `AuditOpinion `.
156
156
If the app the models are defined in is `yoda ` then the corresponding history table names would be `yoda_auditpoll ` and `yoda_auditopinion `
157
-
157
+
158
158
IMPORTANT: Setting `custom_model_name ` to `lambda x:f'{x}' ` is not permitted.
159
159
An error will be generated and no history model created if they are the same.
160
160
@@ -287,8 +287,8 @@ Change Reason
287
287
Change reason is a message to explain why the change was made in the instance. It is stored in the
288
288
field ``history_change_reason `` and its default value is ``None ``.
289
289
290
- By default, the django-simple-history gets the change reason in the field ``changeReason `` of the instance. Also, is possible to pass
291
- the ``changeReason `` explicitly. For this, after a save or delete in an instance, is necessary call the
290
+ By default, the django-simple-history gets the change reason in the field ``_change_reason `` of the instance. Also, is possible to pass
291
+ the ``_change_reason `` explicitly. For this, after a save or delete in an instance, is necessary call the
292
292
function ``utils.update_change_reason ``. The first argument of this function is the instance and the second
293
293
is the message that represents the change reason.
294
294
@@ -308,7 +308,7 @@ You can create an instance with an implicit change reason.
308
308
.. code-block :: python
309
309
310
310
poll = Poll(question = ' Question 1' )
311
- poll.changeReason = ' Add a question'
311
+ poll._change_reason = ' Add a question'
312
312
poll.save()
313
313
314
314
Or you can pass the change reason explicitly:
0 commit comments