Skip to content

Instantly share code, notes, and snippets.

View stenius's full-sized avatar

Paul Stenius stenius

View GitHub Profile
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active July 10, 2024 14:36
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@devsnd
devsnd / dnd_ordered_admin.py
Last active October 4, 2023 15:27
Quick hack to implement drag and drop for ordered model django admin
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):