crud

Add Radio Button in gender feied in crud django

Add Radio Button in gender feied in crud django Question: i have a CRUD PROJECT in which i need gender field in radio buttons or in check box i tried to apply those but did not getr the desired result, Radio buttons are not adding if they are adding they are not posting data in …

Total answers: 2

FASTAPI Delete Operation giving Internal server error

FASTAPI Delete Operation giving Internal server error Question: I have this code for delete operation on a Postgresql DB: @app.delete("/posts/{id}", status_code=status.HTTP_204_NO_CONTENT) def delete_post(id: int): print("ID IS ",id) cursor.execute("""DELETE FROM public."Posts" WHERE id = %s""", (str(id),)) deleted_post = cursor.fetchone() <— Showing error for this line conn.commit() if deleted_post is None: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Post with {id} not …

Total answers: 2

How should I organize my path operations in FastAPI?

How should I organize my path operations in FastAPI? Question: I am creating an application with FastAPI and so far it goes like this: But I’m having a problem with the endpoints. The /api/items/filter route has two query parameters: name and category. However, it gives me the impression that it is being taken as if …

Total answers: 1

SQLALCHEMY – returning a pretty format

SQLALCHEMY – returning a pretty format Question: I am trying to create a basic CRUD application with python using sqlalchemy. It is just a virtual contact book, that runs in the terminal. I have managed to create this and get it working successfully, but I am having trouble with the following: Whenever I run one …

Total answers: 1

FastAPI server returns "422 unprocessable entity" – value_error.missing

FastAPI server returns "422 unprocessable entity" – value_error.missing Question: from http.client import responses from random import randrange from tkinter.tix import STATUS from typing import Optional from urllib import response from fastapi import Body, FastAPI, Response ,status, HTTPException from pydantic import BaseModel app= FastAPI() class Post(BaseModel): title: str content: str Published: bool = True rating: Optional[int] …

Total answers: 1