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

Add Autoincrementing sort value for reverse relationship modification #156

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

EricHigdon
Copy link

When modifying a sortedm2m relationship from the "to" model admin, the default sort value of 0 is used, which means new instance is added to the top of the sorted list. Ideally, new records would be sorted last be default.

Adding an m2m_changed listener for the intermediate model allows us to make sure that new records have a sort value higher than the last item already in the list.

@EricHigdon EricHigdon changed the title Add Autoincrementing for reverse relationship modification Add Autoincrementing sort value for reverse relationship modification Jan 14, 2020
Copy link
Contributor

@clintonb clintonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test/tests.

@@ -1,6 +1,7 @@
[pycodestyle]
max_line_length=120
exclude=migrations
ignore=W0613
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need to disable this, use # pylint: disable=unused-argument at the appropriate location. Do not ignore warnings globally without a discussion. Also, this won't work because Pylint is configured in pylintrc.

@auvipy auvipy self-requested a review March 5, 2020 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants