Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to always select lower id as Master #114

Open
int-ua opened this issue Mar 14, 2017 · 4 comments
Open

Option to always select lower id as Master #114

int-ua opened this issue Mar 14, 2017 · 4 comments

Comments

@int-ua
Copy link
Contributor

int-ua commented Mar 14, 2017

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.

@saxix
Copy link
Owner

saxix commented Mar 16, 2017

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.

@int-ua
Copy link
Contributor Author

int-ua commented Mar 16, 2017

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

master, other = queryset.all()
? And I can imagine there is cases where it's desired.

@int-ua
Copy link
Contributor Author

int-ua commented Mar 16, 2017

Something like ADMINACTIONS_MERGE_MASTER_SELECTION with options

  • default: default ordering defined on Model
  • lower_id: order by 'id'
  • higher_id: order by '-id'

What do you think?

@int-ua int-ua changed the title Always select lower id as Master Option to always select lower id as Master Mar 16, 2017
@saxix
Copy link
Owner

saxix commented Mar 19, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants