added additional admin functionality #20
Open
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.
I've added some admin functionality that I find essential with 'ordered' models, specifically the ability to change object position in list view with up/down links. I've done this by contributing functions to the parent model within the contribute_to_class function. I also added up and down arrow icons as static files.
To use it effectively:
PositionField
PositionAdmin
list_display
should includeposition_up_down_links
I can't speak for the efficiency of what I've added but at the very least it will show a good proof of concept of what makes this more useable as an app. It's probably worth having some drag and drop functionality as well and certainly some template tags and readthedocs.org/sphinx documentation to finish it off.
I would guess it will probably break when there are more than one
PositionField
on one model so that will need fixing.