From f9a896f469867fdf9574adf940221bfde25c51a4 Mon Sep 17 00:00:00 2001 From: Seonghyeon Cho Date: Mon, 26 Jul 2021 23:29:27 +0900 Subject: [PATCH 1/2] Fix space for nested list in markdown --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e223035..d6b0dda 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,11 @@ Inlines may be drag-and-dropped into any order directly from the change form. To add "sortability" to a model, you need to inherit `SortableMixin` and at minimum, define: - The field which should be used for `Meta.ordering`, which must resolve to one of the integer fields defined in Django's ORM: - - `PositiveIntegerField` - - `IntegerField` - - `PositiveSmallIntegerField` - - `SmallIntegerField` - - `BigIntegerField` + - `PositiveIntegerField` + - `IntegerField` + - `PositiveSmallIntegerField` + - `SmallIntegerField` + - `BigIntegerField` - `Meta.ordering` **must only contain one value**, otherwise, your objects will not be sorted correctly. - **IMPORTANT**: You must name the field you use for ordering something other than "order_field" as this name is reserved by the `SortableMixin` class. From 5aeaa27f5bd7a8f435ec8bc6d84648c9580f479a Mon Sep 17 00:00:00 2001 From: Seonghyeon Cho Date: Mon, 26 Jul 2021 23:31:24 +0900 Subject: [PATCH 2/2] Add warning emojis --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d6b0dda..2699abd 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,8 @@ To add "sortability" to a model, you need to inherit `SortableMixin` and at mini - `SmallIntegerField` - `BigIntegerField` -- `Meta.ordering` **must only contain one value**, otherwise, your objects will not be sorted correctly. -- **IMPORTANT**: You must name the field you use for ordering something other than "order_field" as this name is reserved by the `SortableMixin` class. +- ⚠️ `Meta.ordering` **must only contain one value**, otherwise, your objects will not be sorted correctly. +- ⚠️ **IMPORTANT**: You must name the field you use for ordering something other than "order_field" as this name is reserved by the `SortableMixin` class. - It is recommended that you set `editable=False` and `db_index=True` on the field defined in `Meta.ordering` for a seamless Django admin experience and faster lookups on the objects. Sample Model: @@ -442,7 +442,7 @@ It is also possible to sort a subset of objects in your model by adding a `sorti #### Self-Referential SortableForeignKey You can specify a self-referential SortableForeignKey field, however the admin interface will currently show a model that is a grandchild at the same level as a child. I'm working to resolve this issue. -##### Important! +##### ⚠️ Important! django-admin-sortable 1.6.6 introduced a backwards-incompatible change for `sorting_filters`. Previously this attribute was defined as a dictionary, so you'll need to change your values over to the new tuple-based format. An example of sorting subsets would be a "Board of Directors". In this use case, you have a list of "People" objects. Some of these people are on the Board of Directors and some not, and you need to sort them independently.