File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,23 @@ third-party apps you don't have control over. Here's an example of using
64
64
65
65
register(User)
66
66
67
+ If you want to separate the migrations of the historical model from those of
68
+ the third-party model itself you can pass a module as ``app `` attribute to
69
+ ``register ``. For instance, if the migrations shall live in the migrations
70
+ folder of the package you register the model in, you could do:
71
+
72
+ .. code-block :: python
73
+
74
+ register(User, app = __package__ )
75
+
76
+ You can pass attributes of ``HistoricalRecords `` directly to ``register ``:
77
+
78
+ .. code-block :: python
79
+
80
+ register(User, excluded_fields = [' last_login' ]))
81
+
82
+ For a complete list of the attributes you can pass to ``register `` we refer
83
+ to the source code.
67
84
68
85
Allow tracking to be inherited
69
86
---------------------------------
@@ -428,4 +445,4 @@ This may be useful when you want to construct timelines and need to get only the
428
445
new_record, old_record = p.history.all()
429
446
delta = new_record.diff_against(old_record)
430
447
for change in delta.changes:
431
- print (" {} changed from {} to {} " .format(change.field, change.old, change.new))
448
+ print (" {} changed from {} to {} " .format(change.field, change.old, change.new))
You can’t perform that action at this time.
0 commit comments