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

Add feature for safely accessing related attributes #27

Open
robinzachmann opened this issue Jul 15, 2024 · 0 comments
Open

Add feature for safely accessing related attributes #27

robinzachmann opened this issue Jul 15, 2024 · 0 comments

Comments

@robinzachmann
Copy link
Contributor

The problem

foo = Foo.objects.all().get()
foo.bar  # <-- this will silently cause a sub-query
foo = Foo.objects.all().get()
foo.bar  # <-- this will silently cause a sub-query

Idea

Create a function for safely accessing foo.bar which complains if the attribute would cause an extra query.

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