This guide assumes a fresh install of Mac OSX 10.7 Lion.
This file contains 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
class DragndropOrderedModelAdmin(OrderedModelAdmin): | |
def move_above_view(self, request, object_id, other_object_id): | |
obj = get_object_or_404(self.model, pk=unquote(object_id)) | |
other_obj = get_object_or_404(self.model, pk=unquote(other_object_id)) | |
obj.above(other_obj) | |
# go back 3 levels (to get from /pk/move-above/other-pk back to the changelist) | |
return HttpResponseRedirect('../../../') | |
def get_urls(self): | |
def wrap(view): |