{"id":16417321,"url":"https://github.com/matthiask/django-admin-ordering","last_synced_at":"2025-04-04T14:04:52.585Z","repository":{"id":46829033,"uuid":"55763903","full_name":"matthiask/django-admin-ordering","owner":"matthiask","description":"Drag-drop orderable change lists and inlines done right.","archived":false,"fork":false,"pushed_at":"2025-03-05T16:13:06.000Z","size":232,"stargazers_count":65,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T19:51:29.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthiask.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-08T08:39:22.000Z","updated_at":"2025-03-05T16:13:11.000Z","dependencies_parsed_at":"2024-01-22T18:08:09.958Z","dependency_job_id":"d7aa8b75-a565-443e-817e-5a1fdc746806","html_url":"https://github.com/matthiask/django-admin-ordering","commit_stats":{"total_commits":162,"total_committers":7,"mean_commits":"23.142857142857142","dds":0.07407407407407407,"last_synced_commit":"a001c448f71c6ae2d29bc0c0cb8f95884a2d60a1"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiask%2Fdjango-admin-ordering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiask%2Fdjango-admin-ordering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiask%2Fdjango-admin-ordering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthiask%2Fdjango-admin-ordering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthiask","download_url":"https://codeload.github.com/matthiask/django-admin-ordering/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190246,"owners_count":20898702,"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-11T07:11:26.361Z","updated_at":"2025-04-04T14:04:52.549Z","avatar_url":"https://github.com/matthiask.png","language":"Python","readme":"==============================================================================\ndjango-admin-ordering -- Orderable change lists and inlines done right^Wsimple\n==============================================================================\n\n.. image:: https://github.com/matthiask/django-admin-ordering/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/matthiask/django-admin-ordering/\n    :alt: CI Status\n\nPlease refer to the CI build linked above for the currently supported\ncombinations of Python and Django.\n\n\nInstallation\n============\n\n``pip install django-admin-ordering``, and add ``admin_ordering`` to\n``INSTALLED_APPS``.\n\n\nUsage\n=====\n\nFirst, you need a model ordered by an integer field. If you are happy\nwith a model where 1. the ordering field is called ``ordering`` and 2.\nthe ordering field is automatically initialized so that new objects are\nordered last you can also inherit the abstract\n``admin_ordering.models.OrderableModel`` model. If you define your own ``class\nMeta`` you should inherit ``OrderableModel.Meta`` so that the ``ordering``\nattribute is set to the correct value:\n\n.. code-block:: python\n\n    from admin_ordering.models import OrderableModel\n\n    class MyModel(OrderableModel):\n        # ...\n\n        class Meta(OrderableModel.Meta):\n            # ...\n\n\nOrderable change lists\n~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    from admin_ordering.admin import OrderableAdmin\n\n    @admin.register(MyModel)\n    class MyModelAdmin(OrderableAdmin, admin.ModelAdmin):\n        # The field used for ordering. Prepend a minus for reverse\n        # ordering: \"-ordering\"\n        # Doesn't have to be provided as long as you're using the default.\n        # ordering_field = \"ordering\"\n\n        # You may optionally hide the ordering field in the changelist:\n        # ordering_field_hide_input = False\n\n        # You may optionally add up/down arrows to reorder by click instead of dragging:\n        # ordering_field_up_down_arrows = True\n\n        # The ordering field can optionally be automatically renumbered when\n        # the page loads. This may be useful if you have existing data which\n        # isn't ordered yet.\n        # ordering_field_renumber_on_load = False\n\n        # The ordering field must be included both in list_display and\n        # list_editable:\n        list_display = [\"name\", \"ordering\"]\n        list_editable = [\"ordering\"]\n\n\nOrderable inlines\n~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    from admin_ordering.admin import OrderableAdmin\n\n    class MyModelTabularInline(OrderableAdmin, admin.TabularInline):\n        model = MyModel\n\n        # Same as above; \"-ordering\" is also allowed here:\n        # ordering_field = \"ordering\"\n        # ordering_field_hide_input = False\n        # ordering_field_up_down_arrows = False\n        # ordering_field_renumber_on_load = False\n\n``OrderableAdmin`` comes with a default of ``extra = 0`` (no extra\nempty inlines shown by default). It is strongly recommended to leave the\nchanged default as-is, because otherwise you'll end up with invalid\ninlines just because you wanted to change the ordering.\n\n\nLimitations\n===========\n\n- ``OrderableAdmin`` can be used both for inlines and parents, but this\n  also means that you cannot register a model directly with\n  ``OrderableAdmin``.\n- Using django-admin-ordering with filtered or paginated lists may\n  produce unexpected results. The recommendation right now is to set\n  `list_per_page` to a bigger value and not reordering filtered\n  changelists.\n- Note that django-admin-ordering assigns ordering values in increments\n  of 10, emphasizing that the ordering value should not have any\n  significance apart from giving relative ordering to elements.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiask%2Fdjango-admin-ordering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthiask%2Fdjango-admin-ordering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthiask%2Fdjango-admin-ordering/lists"}