Option to always select lower id as Master
int-ua opened this issue · 4 comments
Can it be done? Because it seems that since lower ids were always created before higher ones it greatly increases chances of latter ones being duplicates with lower number of relations.
could be an option, I'm thinking to add a "swap" option on the preview screen that replay the preview with the inverted records, this should be a better improvement. Thanks for the hint, I'll try to work on it soon, but not free time available at the moment.
But swap
is already available on the first screen, so manual selection of master is possible anyway, what I suggest is adding a global option [1] to select id in a standardised way on different models.
[1] Do I understand correctly that currently it respects Models' ordering
because just queryset.all()
is executed in
django-adminactions/src/adminactions/merge.py
Line 151 in 3b7cbeb
Something like ADMINACTIONS_MERGE_MASTER_SELECTION
with options
default
: defaultordering
defined on Modellower_id
: order by'id'
higher_id
: order by'-id'
What do you think?
ops... seems I have forgotten my code..I got your point and I found your idea reasonable.
Feel free to post a PR and relative documentation. I'll happy to merge it.