sfm-ui
sfm-ui copied to clipboard
Added command for extracting users and collections
Django command creates a CSV of users and collections, useful to contacting users, etc.
To test, run the following in the sfm-docker directory (where output.csv is the name of the desired output file):
docker-compose run ui /opt/sfm-ui/sfm/manage.py getusercollections /sfm-data-shared/output.csv
@dolsysmith I think it would be helpful to add the numeric collection identifier as well (and perhaps also the parent collection_set identifier)
@dolsysmith The additional fields show up successfully and will be helpful. Is docker-compose run ui /opt/sfm-ui/sfm/manage.py getusercollections /sfm-data-shared/output.csv supposed to place the csv file locally (i.e. on the host from where I'm running docker-compose? I had to shell into the container to get the file. Just making sure that's what you intended.
This new getusercollections management command deserves an entry in the readthedocs. Maybe here https://sfm.readthedocs.io/en/stable/administration.html or here https://sfm.readthedocs.io/en/stable/processing.html#sfm-commandline-tools ?
@kerchner If you have DATA_SHARED_DIR mapped to sfm-data-shared in docker-compose.yml, then the CSV should be available in whatever directory (outside the container) is represented by DATA_SHARED_DIR. That's how it's configured on prod.
@dolsysmith Got it, I see it there now in the directory mapped to DATA_SHARED_DIR.