django-gsheets
django-gsheets copied to clipboard
Sync will create duplicate
The current management command does both sync pull and push, this could create duplicates when the row deleted from the admin panel, then run the sync command.
How to reproduce
- Delete one/or all row from specific models via admin panel
- Run sync management command
- All data will be duplicated
My proposal was to be able to give the management command optional argument to run only pull or only push action. Can I make PR for this?
Anyway, I just saw this docstring on the source code
functionality to pull data from a google sheet and use that data to keep model data updated. Notes:
* won't delete rows that are in the DB but not in the sheet
* won't delete rows that are in the sheet but not the DB
* will update existing row values with values from the sheet
So, if I'm not mistaken, the current command isn't able to delete from 1 of the source (DB or Sheet) and then sync the result correct?