wainuiomata / sambal

Experimental web admin for Samba and Active Directory domains
https://wainuiomata.com
GNU General Public License v3.0
1 stars 1 forks source link

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

Open robvdl opened 7 months ago

robvdl commented 7 months ago

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 commented 7 months ago

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.