Skip to content

[Question] Logging related model attributes #797

Answered by Gummibeer
clarg18 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

the related model attribute logging isn't meant/thought to log changes on multiple models but to log data from a related model that's important for the log context.
Just an explicit use-case: you have a Product and ProductCode model to split logic and keep the product model itself cleaner. But the product code is very important so you want to have it in every log as it's also the human-readable product identifier.

If you ONLY change the address in this place you could change the order of update queries which should lead to the updated address in the product log entry.
But I would really recommend to use dedicated logs and let the address model log its own activities. By using some el…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Gummibeer
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
Converted from issue

This discussion was converted from issue #797 on September 30, 2020 18:34.