-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added history tracking to ManyToManyFields
...that exist on models that already have history tracking. Note that the many-to-many selection for these fields *are* correctly saved, they're just currently not correctly displayed in the objects' history page in Django admin (the *current* M2M selection is always shown); see jazzband/django-simple-history#1063.
- Loading branch information
Showing
6 changed files
with
191 additions
and
3 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
contentbox/migrations/0015_historicalcontentbox_extra_change_permissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Generated by Django 4.1.3 on 2022-11-21 03:42 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
("contentbox", "0014_history_date_db_index"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="HistoricalContentBox_extra_change_permissions", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigIntegerField( | ||
auto_created=True, blank=True, db_index=True, verbose_name="ID" | ||
), | ||
), | ||
("m2m_history_id", models.AutoField(primary_key=True, serialize=False)), | ||
( | ||
"contentbox", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="contentbox.contentbox", | ||
), | ||
), | ||
( | ||
"history", | ||
models.ForeignKey( | ||
db_constraint=False, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="contentbox.historicalcontentbox", | ||
), | ||
), | ||
( | ||
"permission", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="auth.permission", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "HistoricalContentBox_extra_change_permissions", | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Generated by Django 4.1.3 on 2022-11-21 03:42 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("faq", "0005_history_date_db_index"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="HistoricalQuestion_categories", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigIntegerField( | ||
auto_created=True, blank=True, db_index=True, verbose_name="ID" | ||
), | ||
), | ||
("m2m_history_id", models.AutoField(primary_key=True, serialize=False)), | ||
( | ||
"category", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="faq.category", | ||
), | ||
), | ||
( | ||
"history", | ||
models.ForeignKey( | ||
db_constraint=False, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="faq.historicalquestion", | ||
), | ||
), | ||
( | ||
"question", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="faq.question", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "HistoricalQuestion_categories", | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
groups/migrations/0013_historicalinheritancegroup_own_permissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Generated by Django 4.1.3 on 2022-11-21 03:42 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
("groups", "0012_history_date_db_index"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="HistoricalInheritanceGroup_own_permissions", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigIntegerField( | ||
auto_created=True, blank=True, db_index=True, verbose_name="ID" | ||
), | ||
), | ||
("m2m_history_id", models.AutoField(primary_key=True, serialize=False)), | ||
( | ||
"history", | ||
models.ForeignKey( | ||
db_constraint=False, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="groups.historicalinheritancegroup", | ||
), | ||
), | ||
( | ||
"inheritancegroup", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="groups.inheritancegroup", | ||
), | ||
), | ||
( | ||
"permission", | ||
models.ForeignKey( | ||
blank=True, | ||
db_constraint=False, | ||
db_tablespace="", | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="+", | ||
to="auth.permission", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "HistoricalInheritanceGroup_own_permissions", | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters