Why is it possible to import empty rows?
They should not be skipped?
I have applied the fix there in pyexcel-io: pyexcel/pyexcel-io#1
You can get it before I release it via:
pip install git+https://github.com/chfw/pyexcel-io.git
Please let me know if it works for you
Hey, that works fine, but only in a situation where the model does not have fields with the value "unique = True".
I tested a situation when the database is already one of the fields blank with the parameter "unique=True"
duplicate key value violates unique constraint "expenses_expensestype_expenses_type_key"
DETAIL: Key (expenses_type)=() already exists.
Therefore, I think a good solution would be to introduce a parameter that allowed to skip the already existing values.
By default, pyexcel give '' for empty cell but I think database treat null as empty. In your case, I guess it is because '' was given toexpenses_type and if '' is given at the second time, it will hit unique key problem. So, I suppose if pyexcel replace '' for None in your case, would it help?
This would help only if the blank and duplicate were changed to None. This would eliminate the problem of unique.
tried, 'None' field does not work for Django. I have another solution and am working on it. Here is the issue tracker for it. pyexcel/pyexcel-io#2
Please try the newer fix again:
Hope it make your use case smooth.
I have to say it will be slow if your data size is huge but for now, I couldn't think of other faster way.
Hello, I tested and working properly. In the case where the model have a unique value duplicate and blank lines are ignored. In the case of large amounts of data can be divided and import parcels.
Thank you very much!
pyexcel-io v0.0.5 with two fixes was just published to pypi.