I'm usign django-excel
library in my Django project, and I want to skip some rows before save it to the database using the save_to_database()
method.
I have something like the following:
file = form.cleaned_data['file']
file.save_to_database(
model=MyModel,
mapdict = fields,
initializer=self.choice_func,
)
All is working ok but I want to validate the data before call save_to_database
function. The idea to do it is to add the rows that are not valid in an array and return it to notify the user that those fields not were saved.