-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
base: master
Are you sure you want to change the base?
Conversation
…ignal listener should be used instead.
…t accept keyword arguments (**kwargs)
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
.
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.