Re: DB cursor.fetchall() convert ot custom model object

2024-06-29 Thread Shreyansh jain
Thanks On Tuesday 18 June 2024 at 17:06:30 UTC+5:30 mr.kri...@gmail.com wrote: > > import sqlite3 > import json > > # Reconnect to the SQLite database > conn = sqlite3.connect('example.db') > cur = conn.cursor() > > # Execute the query > cur.execute("SELECT Name, Address FROM your_table") > > # F

Re: DB cursor.fetchall() convert ot custom model object

2024-06-18 Thread Krishna Maru
import sqlite3 import json # Reconnect to the SQLite database conn = sqlite3.connect('example.db') cur = conn.cursor() # Execute the query cur.execute("SELECT Name, Address FROM your_table") # Fetch all rows from the executed query rows = cur.fetchall() # Get column names from the cursor descr