Upload files in FastAPI with file validationFile upload and validation can get tricky when it comes to FastAPI as we simply cannot use pydantic to do validations for us. Let's see how to get this done from fastapi import UploadFile @app.post("/file") def upload_file(file: UploadFile): val...2 min read路jayhawk24.hashnode.devSep 8, 2023
How to implement pagination in FastAPI feat. SQLAlchemyIn this blog, I will explain how we can implement custom pagination in FastAPI without any external packages. from typing import Generic, List, TypeVar from pydantic import BaseModel, conint from pydantic.generics import GenericModel class PageParam...2 min read路jayhawk24.hashnode.devMar 18, 2023
How to auto fix lint errors in a Pull Request (isort & black)Auto fix lint errors like spacing, sorting imports and much more, let Github Actions create a commit for you fixing them.1 min read路jayhawk24.hashnode.devFeb 8, 2023
Automatically apply to jobs with this python bot.Applying to jobs can be a tedious job why not let a bot handle it? I personally love Instahyre as they don鈥檛 ask any follow-up questions and it's just one click to apply. So let's use python to do this instead. from selenium import webdriver from sel...2 min read路jayhawk24.hashnode.devJan 28, 2023
Manipulate child state from parent in React.Using refs we can invoke methods of child components from a parent in both class components as well as in functional components. This is just a workaround, recommended way is to lift the state up to the parent and then pass it through props to the ch...2 min read路jayhawk24.hashnode.devJan 8, 2023