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

ContainerResource and containers prevent loading of nested data or lazy-loading #55

Open
robvdl opened this issue Mar 16, 2024 · 1 comment

Comments

@robvdl
Copy link
Member

robvdl commented Mar 16, 2024

The RootFactory will start traversal right now and every time it hits a ContainerResource that triggers another query.

On my test domain, there isn't enough data that this is an issue, but I can imagine it will be on larger databases.

Only the views in src/sambal/views/domain.py actually exclude nested data, but it still traverses because every time it hits a ContainerResource it triggers another query and constructs child Resources.

I think it will be possible to stop traversal once it hits nested data, but to do so, the Resource would have to look at the request object passed into the constructor. Luckily it is available to the constructor so this should be possible.

@robvdl
Copy link
Member Author

robvdl commented Mar 16, 2024

This should not be done until there is good test coverage for the existing traversal views. Once that is locked in with tests we can look at improving this.

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