-
Notifications
You must be signed in to change notification settings - Fork 46
Feat/index assets given a root node and/or depth #1874
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
Conversation
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Documentation build overview
Show files changed (7 files in total): 📝 7 modified | ➕ 0 added | ➖ 0 deleted
|
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
nhoening
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying this in Swagger, and it seems to me that this works, but only if I also set either the account_id (and it has to be the one of the root asset) or I set all_accessible to true.
Can you confirm that?
…ex-assets-given-root-node-and-depth
No, I can't, although I did reproduce a situation that resembles your description. The |
Signed-off-by: F.N. Claessen <felix@seita.nl>
Okay, thanks, I get it now.
I can confirm this works without an |
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…pecified Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…ex-assets-given-root-node-and-depth
nhoening
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this for a bit and I believe it does what is advertised.
I have a small questions, but we can also move on.
| account_ids = [account.id] | ||
| include_public_assets = False | ||
| else: | ||
| use_all_accounts = all_accessible or root_asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you decide to turn use_all_accounts to True if root_asset is given (instead of only giving access to root_asset.owner), because some children might have a different owner than root_asset? I'm not sure that is possiblem just asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you are exactly right. So far we have always left open the possibility of having an asset tree with multiple owners involved. Although I have not entirely thought through its implications, I can imagine one might encounter the need in practice, perhaps involving chargers and EVs owned by different organisations, or a community asset (owned by some shared organisation) of (private) sites.
Description
documentation/changelog.rstdocumentation/api/change_log.rstCloses #1886
Look & Feel
How to test
http://localhost:5000/api/v3_0/assets?root=<asset-id>&depth=1Further Improvements
assetsmenu item shows all accessible assetsui.views.assets.utils.get_list_assets_chartis a recursive function that might make use of the recursive CTE, but this is probably only worthwhile for large enough trees where we might notice a considerable delay (in loading the asset context page).Related Items