I am developing an app in Django.
I want to load data inside my model, that is glossary_entry
, but the data is stored inside an xlsx file, that is
I solved the problem by substituting the first code block I showed in the first queston with this piece below:
import pandas as pd
from myapp.models import glossary_entry
def pour_entire_entry_model():
elements = glossary_entry.objects.all()
for element in elements:
entry = acquired_terminology.objects.create()
entry.Lemma = element.Lemma
entry.Acronym = element.Acronym
entry.Definizione = element.Definizione
# creates a tuple of the new object or
# current object and a boolean of if it was created