veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

293
active users

#fastapi

1 post1 participant0 posts today
Emelia 👸🏻<p>Over the past few days in the small moments when I've been able to work I've been experimenting with porting Hasher-Matcher-Actioner from Flask to FastAPI, and I now have it mostly working with an existing database.</p><p>It's been interesting working with python because I don't work with it much, but FastAPI still feels very much like Express in terms of how things are written — lots of building your own framework essentially, instead of "here's the given path", which can be daunting.</p><p>I still need to work out Alembic and migrations, but I have it working against an existing database with the same schema. Also need to figure out building CLI tools that accompany the server, where flask has that built-in</p><p><a href="https://hachyderm.io/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://hachyderm.io/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a></p>
Ranjan Kumar<p>Built my first AI chatbot using LangGraph + FastAPI + React! 🚀<br>It’s live, it works great on mobile &amp; desktop, and yes — it's open source too.</p><p>From clean chat bubbles to smart error handling, I’ve shared everything in detail.</p><p>👉 Read full here:<br><a href="https://iranjankumar.com/building-my-first-very-basic-ai-chatbot-with-langgraph-added-react-frontend-and-fastapi-backend/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">iranjankumar.com/building-my-f</span><span class="invisible">irst-very-basic-ai-chatbot-with-langgraph-added-react-frontend-and-fastapi-backend/</span></a></p><p><a href="https://mastodon.social/tags/ai" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ai</span></a> <a href="https://mastodon.social/tags/chatbot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>chatbot</span></a> <a href="https://mastodon.social/tags/langgraph" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>langgraph</span></a> <a href="https://mastodon.social/tags/reactjs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>reactjs</span></a> <a href="https://mastodon.social/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://mastodon.social/tags/groq" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>groq</span></a> <a href="https://mastodon.social/tags/fullstackdeveloper" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fullstackdeveloper</span></a> <a href="https://mastodon.social/tags/indiedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indiedev</span></a> <a href="https://mastodon.social/tags/buildinpublic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>buildinpublic</span></a></p>
Marcus Almeida<p>Built a Python library to enable HTTP method override through form parameters or headers — supports PUT, DELETE, PATCH, and more.</p><p><a href="https://github.com/marcuxyz/wsgi_method_override" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/marcuxyz/wsgi_metho</span><span class="invisible">d_override</span></a></p><p><a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/wsgi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wsgi</span></a> <a href="https://mastodon.social/tags/http" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>http</span></a> <a href="https://mastodon.social/tags/flask" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>flask</span></a> <a href="https://mastodon.social/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://mastodon.social/tags/django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>django</span></a></p>
spla :fed: :vim:<p>700 "commits" ja 😅 </p><p><a href="https://mastodont.cat/tags/appy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>appy</span></a> <a href="https://mastodont.cat/tags/fastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastAPI</span></a> <a href="https://mastodont.cat/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Thea<p>Finally got my FastAPI app deployed on Vercel after some trial and error 💪<br>Wrote down everything I learned because I know I'll forget these steps in 2 weeks😅<br>Maybe it'll help someone else too 👩‍💻<br><a href="https://mastodon.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://mastodon.social/tags/Vercel" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Vercel</span></a> <a href="https://mastodon.social/tags/DEVCommunity" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DEVCommunity</span></a><br><a href="https://dev.to/highflyer910/deploy-your-fastapi-app-on-vercel-the-complete-guide-27c0" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dev.to/highflyer910/deploy-you</span><span class="invisible">r-fastapi-app-on-vercel-the-complete-guide-27c0</span></a></p>
𝕂𝚞𝚋𝚒𝚔ℙ𝚒𝚡𝚎𝚕<p>Choosing a hash function for 2030 and beyond: SHA-2 vs SHA-3 vs BLAKE3</p><p>As everyone knows, "temporary fixes" are nothing but temporary.<br>Unfortunately, the same is true for cryptography: unless security is your core value-proposition, crypto algorithms are almost never updated, and that's how we end up with SHA1-hashed password in 2024 🤦‍♂️</p><p># <a href="https://kerkour.com/fast-secure-hash-function-sha256-sha512-sha3-blake3" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">kerkour.com/fast-secure-hash-f</span><span class="invisible">unction-sha256-sha512-sha3-blake3</span></a></p><p><a href="https://chaos.social/tags/hash" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hash</span></a> <a href="https://chaos.social/tags/hashfunctions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hashfunctions</span></a> <a href="https://chaos.social/tags/coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coding</span></a> <a href="https://chaos.social/tags/sha2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sha2</span></a> <a href="https://chaos.social/tags/hashing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hashing</span></a> <a href="https://chaos.social/tags/itsec" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>itsec</span></a> <a href="https://chaos.social/tags/itsecurity" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>itsecurity</span></a> <a href="https://chaos.social/tags/sha3" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sha3</span></a> <a href="https://chaos.social/tags/BLAKE3" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BLAKE3</span></a> <a href="https://chaos.social/tags/fast" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fast</span></a> <a href="https://chaos.social/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://chaos.social/tags/feature" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>feature</span></a></p>
nathan<p>I wrote a few words on my new work environment — I’m not an iOS dev amymore, but write <a href="https://chaos.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> code with <a href="https://chaos.social/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> nowadays. And I also decided to postpone the purchase of a new computer for another month or so. It will most likely be a <span class="h-card" translate="no"><a href="https://fosstodon.org/@frameworkcomputer" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>frameworkcomputer</span></a></span></p><p><a href="https://zeitschlag.net/new-job-new-os/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">zeitschlag.net/new-job-new-os/</span><span class="invisible"></span></a></p>
dilawar<p>I am probably holding them wrong!</p><p>This time I tried writing a web app not in <a href="https://fosstodon.org/tags/php" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>php</span></a> but <a href="https://fosstodon.org/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> + <a href="https://fosstodon.org/tags/sqlmodel" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlmodel</span></a> (python) and <a href="https://fosstodon.org/tags/vue3" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue3</span></a> ( javascript). It kind of works well but refactoring is a nightmare. </p><p>In the beginning, it felt like I was having the best of both worlds -- Python and Vue3. Dev speed was good. Now maintaining and refactoring make me feel like I am having the worst of both worlds.</p><p>As a single dev, I should have stayed with <a href="https://fosstodon.org/tags/php" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>php</span></a>!</p>
Chris Gioran 💔<p>So, as it turns out, I have a new project in the works.</p><p>And it's not a new DBMS. </p><p>It's a data/publishing platform for journalists. Not quite a CMS, not quite an archival service. We're gathering requirements now, so I'll have a better description soon.</p><p>I am looking at <a href="https://fosstodon.org/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> for the backend w/#Astro for the frontend/client. I've never built anything like this before, so expect silliness forthwith.</p>
Adam ♿<p>Take me back to ASP.NET please.</p><p><a href="https://github.com/fastapi/fastapi/discussions/13449" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/fastapi/fastapi/dis</span><span class="invisible">cussions/13449</span></a></p><p><a href="https://aus.social/tags/FastAPI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FastAPI</span></a> <a href="https://aus.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Aaron Longchamps<p>The goal for Rack Root is to inventory my home lab and learn some web dev (FE+BE) along the way. I'm now at the point where I think I'll have the biggest challenge: IPAM / networking data.</p><p>I'm anticipating that this part will be the most complex because of all the relationships. This is also going to test my API and database design skills, to say nothing of the front end design.</p><p>At the start, I'm going to need a good IPv4 address handler library, ways to CRUD network segments, CRUD DHCP ranges, assign static IPs to devices, and similar.</p><p>I also will have the data to generate visualizations of IP address usage, and plan to do that at some point.</p><p>I fully expect to take advantage of things like Vuetify 3's v-card element which should help with some nifty graphical layouts.</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/applicationdesign" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>applicationdesign</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>backend</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a></p>
Aaron Longchamps<p>Finished the NewItem.vue page for now with a better layout, date pickers for purchase date and warranty expiration, and a placeholder for devices on the network.</p><p>My next plan is to start designing the networking piece of Rack Root and figure out which pieces I'll need to put in place. This will include the network zone, DHCP ranges, and subnet mask info. Devices on the network can be DHCP or static which is data I plan to track.</p><p>Items will have the ability to use 0..n network interfaces which accounts for things not on the network such as hard drives, single-NIC devices such as laptops, and multi-NIC devices such as network devices. All of that can go into the database.</p><p>By the time it's done, I should have the data to generate a pretty good picture of the network layout such as DHCP range utilization and IP utilization. Somewhere along the way I'll need to figure out subnet math, too. Yay.</p><p><a href="https://infosec.exchange/tags/homelab" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>homelab</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/sideproject" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sideproject</span></a> <a href="https://infosec.exchange/tags/networking" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>networking</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a></p>
Aaron Longchamps<p>Now to the new item functionality.</p><p>First screenshot shows a summary of test values in the table, and the date is formatted on the frontend so it looks the way I want.</p><p>Second screenshot shows the new item page which is definitely still a work in progress. I have a lot of functionality to add to this one, and figure out what layout I want to use for it. I'm using things like v-field, v-textarea, and v-date-picker for these elements. The buttons are of course using v-btn.</p><p>The last screenshot shows the item detail page and this design is definitely not final. I'm not even showing the notes or descriptions fields in this view. I really should sketch out some things I want to do in order to use this the way I want.</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/ux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ux</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>backend</span></a> <a href="https://infosec.exchange/tags/sideproject" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sideproject</span></a></p>
Aaron Longchamps<p>And now for some screenshots.</p><p>First screenshot shows the landing page with basic summaries.</p><p>Second screenshot shows the new device type tab on the settings page.</p><p>Third screenshot shows another tab I setup for export/import functionality. That one will be interesting to write, for sure.</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/ux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ux</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>backend</span></a> <a href="https://infosec.exchange/tags/sideproject" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sideproject</span></a></p>
Aaron Longchamps<p>Well, it's been a month or so since I've posted so here's what I've changed/learned about.</p><p>It was easier for me to use DateTime than Date, even if I just want to hold a Date field. I also started to really build out some of the more dynamic functionality.</p><p>Device types can now be defined on the setting page, tab 1 and I'm using a modal textbox that pops up when you go to add a new item. All that needs is a name so a model makes a lot of sense for that.</p><p>When making a new item, the device types are pulled over dynamically and displayed as human-friendly names in a drop down. In the code and going to the back end, it's all using the ID. This field is also nullable in case the device type gets deleted, it won't throw as many exceptions.</p><p>I also wrote up the item detail page, though both the new item page and item detail page tell me that I need better UX design / more layout experience. This stuff isn't easy!</p><p>Finally on the design side of things, I've added a couple dynamic boxes to the landing page that show how many items and device types are defined. This is another part of the site I'll work to design more as I go.</p><p>I'm sure I will find something that looks good and functions the way I want – I just need to get there. And I can tell by where I am now that this project will keep me busy for as long as I want it to.</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/ux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ux</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>backend</span></a> <a href="https://infosec.exchange/tags/sideproject" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sideproject</span></a></p>
Aaron Longchamps<p>This afternoon's update focused on two things: testing and adding the foreign key relationship to the back end.</p><p>I re-enabled most of my tests which should make future development a lot faster, updated them a lot to cover the new foreign key for device types on inventory items, and added several tests for device types.</p><p>I'll integrate this with the front end now that the back end _should_ be good and see how that goes.</p><p>Latest code is up on my GitHub here <a href="https://github.com/alongchamps/rack-root" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/alongchamps/rack-ro</span><span class="invisible">ot</span></a></p><p><a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/testing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>testing</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a></p>
Aaron Longchamps<p>I finally have a functional foundation on which to build the front end for Rack Root. For some reason when I was working on it the past few days, the front end code was not cooperating. I reinitialized the project, copied in my existing (previously functional files) and the frontend would just complain about invalid javascript.</p><p>According to Visual Studio Code, everything looked good. I copied the relevant javascript out and it still looked good, no syntax errors. According to my console, there was a javascript error at the end of the &lt;/script&gt; tag in the .vue file.</p><p>Whatever it was, I re-typed the relevant bits/pieces of my code, checked everything incrementally along the way, and got it back to working again.</p><p>Now I can start to write more of the back end code, get it all tested, write the front end to go with it, and so on. Repeat until 'done' ;)</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/vite" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vite</span></a></p>
Aaron Longchamps<p>Over the past few days, I've worked on a design document and started to generate some code for the front end for Rack Root. Now that I have some basis for the tables, I can start putting in the pydantic code to establish the object types, which also means I can start writing the CRUD operations on the back end.</p><p>Once that's in place, I plan to go after the basic skeleton of the frontend code such as setting up the navigation bar, settings page, and basic inventory operations.</p><p><a href="https://github.com/alongchamps/rack-root/blob/main/design.md" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/alongchamps/rack-ro</span><span class="invisible">ot/blob/main/design.md</span></a></p><p><a href="https://infosec.exchange/tags/development" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>development</span></a> <a href="https://infosec.exchange/tags/software" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>software</span></a> <a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/fullstack" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fullstack</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a> <a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a></p>
Aaron Longchamps<p>I'm learning a lot more about how Vue works and I am liking it a lot. I now have full CRUD operations on:</p><p>Get all items<br>Get single item details<br>Edit item (via HTTP PUT)*<br>Create new item and redirect to the new item's detail page<br>Delete item from the 'all items' page<br>Delete item from the single item details page</p><p>* I also wrote a new backend API for the HTTP PUT operation and associated tests. I already had HTTP PATCH /items/{id}, but that didn't work with my existing code for the front end. I think Vue has a good way to do this with watchers, but I don't have enough understanding of that yet to use it. Maybe that's next!</p><p>As I've been going through this, I really got a good understanding of how to write APIs, how to name fields, leverage JSON, and other fun things. I like how it's coming together in Vue and plan to keep going with it.</p><p>I'm not doing anything yet with error handling so I know I need to start incorporating that. I also want to take a look at the watcher mechanisms.</p><p><a href="https://infosec.exchange/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/vue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vue</span></a> <a href="https://infosec.exchange/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> <a href="https://infosec.exchange/tags/html" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>html</span></a></p>
Aaron Longchamps<p>Success - this is the line that took me entirely too long to write today:</p><p>itemsAffected = db.query(Item).filter(Item.id == item_id).update(dict(**foo.model_dump(exclude_unset=True)))</p><p>with a database session<br>query the Item table<br>for rows that match my item_id<br>update them with properties present in object foo (which is of type ItemUpdate) as a dictionary</p><p>There might be a better way for me to do this, but I didn't find an example online that lined up closely with what I was trying to do.</p><p>I did not want to have repeating code where it was repeating this for every property or even a foreach loop doing something similar, that feels inefficient:</p><p>if db_item.&lt;field&gt; != input_item.&lt;field&gt;<br> db_item.&lt;field&gt; = input_item.&lt;field&gt;</p><p>The Pydantic ItemUpdate has two properties: name and description. The model for the ItemUpdate class defaults to None for everything not specified so you can pass in just { "name": "newnamehere" } and the description property will remain untouched.</p><p>Now I just need to write tests against this to make sure it's all passing properly!</p><p><a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/pydantic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pydantic</span></a> <a href="https://infosec.exchange/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a></p>