Add support for to_field_name to SortedMultipleChoiceField#76
Merged
gregmuellegger merged 1 commit intojazzband:masterfrom May 24, 2016
Merged
Add support for to_field_name to SortedMultipleChoiceField#76gregmuellegger merged 1 commit intojazzband:masterfrom
gregmuellegger merged 1 commit intojazzband:masterfrom
Conversation
Collaborator
|
Cool that makes sense. Thanks for taking the effort to contribute this. I see two things missing here before I can merge this:
|
Contributor
Author
|
I went ahead and made those two changes, let me know if I need to make any more! 👍 |
Collaborator
|
👍 great! Thanks for the contribution, it's merged. |
gregmuellegger
added a commit
that referenced
this pull request
May 24, 2016
Collaborator
|
I just released 1.3.0, containing your changes: https://pypi.python.org/pypi/django-sortedm2m/1.3.0 |
Contributor
Author
|
Awesome, thanks! 🎉 |
|
@conradev @gregmuellegger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current implementation depends on
in_bulk, which requiresvalueto be thepk, when it can actually be any unique field thanks to theto_field_nameattribute.The super implementation handles filtering the queryset, so
cleanonly needs to order the objects. This implementation is partially inspired by how the ModelMultipleChoiceField implements it.