Aaron Longchamps<p>Well I've hit a bit of a wall on the foreign key situation in SQL Alchemy on the backend side of this project.</p><p>I want to have an inventory item with a deviceTypeId field that's an ID number pointing over to the Device Types table. Each Device Type row has an ID and a name. I want the Device Type name to get back over to the inventory item record as another field.</p><p>If that doesn't make sense, maybe this will in JSON: </p><p>Device Type row / example:<br>{ "id": 1, "name": "Synology DS414 NAS" }</p><p>Inventory Item row / example:<br>{ "id": 1, "name": "ds414", "deviceTypeId": 1, ...(other fields) }</p><p>The database relationship I want to have my SQL Alchemy ORM do is this:</p><p>{ "id": 1, "name": "ds414", "deviceTypeId": 1, **"deviceType": "Synology DS414 NAS",**<br>...(other fields) }</p><p>I've seen lots of docs with relationships(...), Mapped(...) calls, Lists, back reference, back populate, and other things.</p><p>For now I really just want to pull over the name field from another table, based on the foreign key ID.</p><p><a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/sqlalchemy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sqlalchemy</span></a> <a href="https://infosec.exchange/tags/orm" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>orm</span></a> <a href="https://infosec.exchange/tags/vscode" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vscode</span></a> <a href="https://infosec.exchange/tags/sqlite" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sqlite</span></a> <a href="https://infosec.exchange/tags/databases" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>databases</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vue</span></a></p>