I am working on a simple application to store sets of collected datapoints into a dataset. I am using the admin interface to handle CRUD management of the dataset objects. I would like to be able to add additional datapoints to an existing dataset instance by importing model data from a file. The error happens when I save the change form, I get the error "object has no attribute 'new_objects'"
I have overridden the admin change view to include a file field that accepts a CSV file containing datapoint data. When the user clicks the Save button, the file should upload and the app should import and save datapoints from the file and associate them with the given dataset. I have googled around for this error and I have seen where others omitted to call the save_m2m() function, but I don't think this is what I am trying to do as I am not using a formset, I am using a file upload.
I have overridden the Dataset ModelAdmin save_model function to accept the file, save the datapoints, and associate them with the given dataset.
Is this the right way to do this? I would appreciate any guidance.
Also, why are the existing datapoints being resubmitted? How can I prevent that from happening?
Thank you