relational-database

Save multiple relational objects in foreign key django

Save multiple relational objects in foreign key django Question: I want to make one to many relation between models and in Django, we need to use ForeignKey for it. I will multiple IDs of the relational objects in an array from the frontend but I’m confused that how will I save these multiple relational object …

Total answers: 1

disk I/O error with SQLite3 in Python 3 when writing to a database

disk I/O error with SQLite3 in Python 3 when writing to a database Question: i am a student just starting out with python, and i was tasked with creating a relational database management system. I think i came pretty far, but i seem to have hit a wall. This is my code: import csv import …

Total answers: 6

How to get foreign key values with getattr from models

How to get foreign key values with getattr from models Question: I have a model Project and i am getting the attributes of that with the following instr attr = getattr(project, ‘id’, None) project is the instance, id is the field and None is the default return type. My question is: what if I want …

Total answers: 2