chicommons / maps

MIT License
5 stars 17 forks source link

Backend: When importing data from Google spreadsheet, need to consolidate entries with the same ID #219

Open laredotornado opened 1 year ago

laredotornado commented 1 year ago

In order to proceed with this ticket, this itcket, https://github.com/chicommons/maps/issues/215, will need to be addressed first.

In our Google spreadsheet, https://docs.google.com/spreadsheets/d/1ifpqYM0uV1S3YVPrce5gmvevJ7jc-cFmOk5jDS8Me7U/edit#gid=0, when generating the seed data script, we need to consolidate rows with the same ID into a single entry. This means that if there are multiple entries with the same ID, the "coopaddresstags" objects in the seed_data file shoudl have the same coop ID, e.g.

- model: directory.coopaddresstags
  pk: 976
  fields:
    is_public: True or False
    coop_id: 856
    address_id: 802
- model: directory.coopaddresstags
  pk: 977
  fields:
    is_public: True or False
    coop_id: 856
    address_id: 803

As a refresher, if you want to run the scripts, log in to the Docker web container (docker exec -it bash) and run

python manage.py init_from_google_sheet > /tmp/output.csv
python manage.py parse_coop_csv /tmp/output.csv > /tmp/seed_data.yaml
python manage.py insert_seed_data /tmp/seed_data.yaml true
stepsbystep commented 1 year ago

I'm on it!

maxgraziano commented 1 month ago

@domdelorenzo @SteveEdiger with 3.1 moving away from spreadsheets, is this obsolete?

domdelorenzo commented 1 month ago

See: https://github.com/chicommons/maps/issues/215#issuecomment-2113735348