datamade / openness-project-nmid

Money Trail NM - New Mexico In Depth's Campaign Finance Explorer
https://moneytrailnm.com
3 stars 1 forks source link

merge candidate functionality #203

Closed fgregg closed 4 months ago

fgregg commented 4 months ago

we need a feature in the admin interface to merge candidates. here's how i think it should work

  1. a search interface to show candidates, probably search by name
  2. select one candidate as the survivor and the one or more others to merge into it the survivor
  3. a confirmation dialogue

For each candidate that is getting merged into the filing, for each of their associated filings, committees, and transactions, change their referenced entity id to the survivor's entity id. Once that has changed, then delete the non-surviving merged candidate.

Note: I have already updated the data import scripts so that this should all work out okay. If it's not me that implements this, you should review the conditions of when a new candidate is created..

fgregg commented 4 months ago

some prior art:

https://django-extensions.readthedocs.io/en/latest/merge_model_instances.html

https://stackoverflow.com/questions/3393378/django-merging-objects

hancush commented 4 months ago

following