{"id":16060355,"url":"https://github.com/claudiob/django-sortable","last_synced_at":"2025-08-25T03:32:24.379Z","repository":{"id":66322399,"uuid":"1896014","full_name":"claudiob/django-sortable","owner":"claudiob","description":"Drag'n'drop support to reorder objects in the Django admin panel, both with and without Grappelli","archived":false,"fork":false,"pushed_at":"2011-04-28T00:17:52.000Z","size":837,"stargazers_count":0,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-18T13:36:25.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claudiob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-14T18:36:57.000Z","updated_at":"2019-02-07T17:44:33.000Z","dependencies_parsed_at":"2023-02-20T02:05:24.041Z","dependency_job_id":null,"html_url":"https://github.com/claudiob/django-sortable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiob%2Fdjango-sortable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiob%2Fdjango-sortable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiob%2Fdjango-sortable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiob%2Fdjango-sortable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claudiob","download_url":"https://codeload.github.com/claudiob/django-sortable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230873001,"owners_count":18293204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T04:03:23.006Z","updated_at":"2024-12-22T18:56:41.422Z","avatar_url":"https://github.com/claudiob.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick start guide\n\n## Download\n\nUsing `pip`:\n\n    pip install sortable\n\nUsing `git`:\n\n    git clone git://github.com/ff0000/django-sortable.git\n    cd django-sortable\n    python setup.py install\n\nor download the package from [github.com/ff0000/django-sortable](https://github.com/ff0000/django-sortable).\n\n## Installation\n\nOpen `settings.py` and add `sortable` to your `INSTALLED_APPS`:\n\n    INSTALLED_APPS = (\n      [...],\n      'sortable',\n    )\n\nCopy the reorder Javascript the `static/js` folder:\n\n    cp [sortable folder]/sortable/static/js/django-admin-sortable.js [django-app]/static/js/\n\n## Reordering instances of a model with drag-and-drop in the admin\n\nTo add the sortable feature a model called `Article` do the following:\n\nEdit `app/articles/models.py` changing `models.Model` with `Sortable`:\n\n    from sortable.models import Sortable\n\n    class Article(Sortable):\n      # here the model fields, Meta, etc.\n\nIf `Meta` is present, inherit from `Sortable.Meta`:\n\n    # Old version\n    class Meta:\n    # New version\n    class Meta(Sortable.Meta):\n\nEdit `app/articles/admin.py` changing `admin.ModelAdmin` with `SortableAdmin`:\n\n    from sortable.admin import SortableAdmin\n    \n    class ArticleAdmin(SortableAdmin):\n      # here the admin stuff \n\nIf `ArticleAdmin` includes the `list_display` declaration, change it like this:\n\n    # Old version\n    list_display = ('__unicode__', ...,)\n    # New version\n    list_display_links = ('__unicode__', )\n    list_display = SortableAdmin.list_display + ('__unicode__', ...,)\n\nThe `list_display_links` indicates which field will show the admin detail page when clicked.\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiob%2Fdjango-sortable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaudiob%2Fdjango-sortable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiob%2Fdjango-sortable/lists"}