Replies: 2 comments 1 reply
-
|
Any code that runs in the UI (javascript) does not have direct database access. It needs to access the database via the API. So you can either:
|
Beta Was this translation helpful? Give feedback.
-
|
That's the problem, I'm having a hard time figuring out how to do that. My thought process is:
I'm just not entirely sure how to get the part information via the All I really need is to figure out what to give the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Probably asked to death, but I couldn't find anything, so it'll be asked again:
I'm working on trying to make a plugin that'll make disassembly of a part into it's sub-parts possible. For my usecase, I get bulk boxes in of stuff (plush, rubber ducks, stickers, etc) that can be broken down into smaller quantities of the stuff that gets put into the external inventories of our customers (usually one box of something goes to multiple customers, so being able to break it down would help loads).
Now, my idea is to use the built in BOM system to know what the main part can be broken down into. Based on the documentation, I can get all that with the database model, same goes with the Part itself.
I just can't figure out how to do that. The sample code generated by the plugin creator uses the UI context to figure out if it's on the part page, but it seems like it only gives out the
target_modelandid, which seems to be the API endpoint ID.Would I need to use the API to query for the part information? Is there no way to use the id value given to me to query the database itself? Is that even the right way to do things?
I'm not new when it comes to programming (got nearly 2 decades of Java with a few years of C/C++ under my belt), but this is my first rodeo with django.
Thank you for any help, and I'm bound to ask even more dumb questions.
Beta Was this translation helpful? Give feedback.
All reactions