<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mikeu28</title>
    <description>The latest articles on DEV Community by Mikeu28 (@mikeu28).</description>
    <link>https://dev.to/mikeu28</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1114344%2F5122910d-f80e-41e1-bd19-0a14d9f380d1.png</url>
      <title>DEV Community: Mikeu28</title>
      <link>https://dev.to/mikeu28</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikeu28"/>
    <language>en</language>
    <item>
      <title>Using .filter in React</title>
      <dc:creator>Mikeu28</dc:creator>
      <pubDate>Mon, 21 Aug 2023 18:39:27 +0000</pubDate>
      <link>https://dev.to/mikeu28/using-filter-in-react-59k4</link>
      <guid>https://dev.to/mikeu28/using-filter-in-react-59k4</guid>
      <description>&lt;p&gt;While learning coding in my bootcamp, I found myself stumped by the way .filter works. This blog is both reinforcement of my own learning and will hopefully help prevent someone else from falling into the same holes that I did.&lt;/p&gt;

&lt;p&gt;To set up a proper filter in react; first we need state.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aROAV7bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mvrpu06k5v11ma675lz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aROAV7bF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mvrpu06k5v11ma675lz.png" alt="Image description" width="427" height="61"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using an event handler such as onChange or onSubmit, we update the states search value with the data we are looking for.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cavy-Ieb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ipxv9hwz4dyf73uejwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cavy-Ieb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ipxv9hwz4dyf73uejwa.png" alt="Image description" width="431" height="22"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a_L07z26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsddyzwom3d5huimo104.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a_L07z26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsddyzwom3d5huimo104.png" alt="Image description" width="477" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the event handler in place, we can now create a variable that will house the data we are filtering for.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ifKyxbAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrd5h8im52qdrvjguc20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ifKyxbAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrd5h8im52qdrvjguc20.png" alt="Image description" width="540" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we ensure that we make a copy of our form data as to not accidentally manipulate it permanently in some way. Filter is then written the same way you would write .map as well.&lt;/p&gt;

&lt;p&gt;Once we have our data we simply update what react displays.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KkL-zdJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j079cf8gnl8tla4mub4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KkL-zdJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j079cf8gnl8tla4mub4n.png" alt="Image description" width="296" height="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React should now display either all the data or what the filtered results show. If nothing matches the search, react will show nothing.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>SQLAlchemy Serializer for Beginners</title>
      <dc:creator>Mikeu28</dc:creator>
      <pubDate>Mon, 21 Aug 2023 18:39:05 +0000</pubDate>
      <link>https://dev.to/mikeu28/sqlalchemy-serializer-for-beginners-3f58</link>
      <guid>https://dev.to/mikeu28/sqlalchemy-serializer-for-beginners-3f58</guid>
      <description>&lt;p&gt;Working with databases and handling data storage in Python can be a daunting task, especially if you're new to programming like I am. Thankfully, there are powerful tools available to make this process much smoother. Enter SQLAlchemy Serializer, a fantastic tool from the SQLAlchemy library that simplifies the way you work with databases. I found myself struggling to grasp this tool so I developed this blog to not only solidify my own understanding but to help those who may have similar struggles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding SQLAlchemy Serializer
&lt;/h2&gt;

&lt;p&gt;Before we dive into the details, let's quickly grasp the concept of serialization. Imagine you have a complex Python object, like a dictionary containing various data points. If you want to store this object in a database, you can't just drop it in – databases work with structured data. That's where serialization comes in. It's the process of converting your Python objects into a structured format (like JSON) that can be stored and retrieved easily from a database.&lt;/p&gt;

&lt;p&gt;This is where SQLAlchemy Serializer steps in. It's like having a translator between your Python code and the database, ensuring smooth communication and data storage.&lt;/p&gt;

&lt;p&gt;Let's say you're building a library management system, and you want to keep track of books. Each book has attributes like title, author, and publication year. Without SQLAlchemy Serializer, you'd have to manually handle the conversion of Python objects to database entries. But with it, you can simplify the process and focus on your application's logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining the Model
&lt;/h2&gt;

&lt;p&gt;In SQLAlchemy, a model is a Python class that represents a table in the database. With SQLAlchemy Serializer, you can easily add serialization capabilities to your model. Let's take a look at how you might define a Book model:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fadE9-A---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ucx9id5120r0jbbwtkpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fadE9-A---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ucx9id5120r0jbbwtkpw.png" alt="Image description" width="553" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The SerializerMixin added to the class enables serialization, allowing you to convert instances of this class to a structured format and back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2v9vFtmd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ceuxncs3m2zgjxxeijvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2v9vFtmd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ceuxncs3m2zgjxxeijvz.png" alt="Image description" width="732" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;SQLAlchemy Serializer is an incredible tool that simplifies working with databases in Python, especially for beginners. By automating the serialization and deserialization process, it allows you to focus on building your application's functionality without getting bogged down in the nitty-gritty details of data storage.&lt;/p&gt;

</description>
      <category>python</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
