Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid m2m selects when diffing #881

Closed
sebashwa opened this issue Sep 14, 2021 · 1 comment
Closed

Avoid m2m selects when diffing #881

sebashwa opened this issue Sep 14, 2021 · 1 comment

Comments

@sebashwa
Copy link

Problem Statement
I'm about to create a timeline using diff_against quite often. Internally it uses django's model_to_dict which fires SQL queries for every ManyToMany field (twice - for every model related to the diff).

Describe the solution you'd like
I'd like to get rid of those SQL queries, as many to many relations are not supported so far.
Therefore I'd like to introspect the model and use the exclude argument to model_to_dict to avoid firing those queries.

Describe alternatives you've considered
Alternatively pass along the excluded fields to model_to_dict to at least give the caller of diff_against the opportunity to exclude many to many relations.

@sebashwa
Copy link
Author

Duplicate of #776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant