How to load the data in the model, the append method takes only one argument, and therefore, how then to use bulk_create ?
def handle_parameters_upload(request, file): wb = openpyxl.load_workbook(file, read_only=True) first_sheet = wb.get_sheet_names()[0] ws = wb.get_sheet_by_name(first_sheet) data = [] for row in ws.iter_rows(row_offset=1): recipe = Recipe.objects.create(par_recipe=row[1].value) line = Line.objects.create(par_machine=row[2].value) order = Order.objects.create(par_fa=row[3].value) parameter = Parameter.objects.create( par_rollennr=row[5].value, par_definition_id=row[6].value, par_name=row[7].value ) measurements = Measurements.objects.create( par_value=row[8].value, id_line=line, id_recipe=recipe, id_order=order, id_parameter=parameter ) data.append(parameter, order, line, measurements, recipe) ???.objects.bulk_create(data) return True