Skip to content

M2M Examples for docs #172

Closed Answered by wesleykendall
xaitec asked this question in Q&A
Oct 14, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

https://django-pghistory.readthedocs.io/en/3.4.4/event_tracking/?h=many#many-to-many-fields discusses how to track M2M fields.

A M2M model effectively just has a primary key and two foreign keys to the relationships. If you check out the example in the docs, two trackers have been set up to just track inserts and deletes to this table, allowing you to preserve a history of when M2M relationships are added and deleted.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@wesleykendall
Comment options

Answer selected by wesleykendall
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants