Thanks for this package! It is working great once I solved the following hick-up.
If you add this package to an existing Wagtail site, sort_order will not be populated on already existing pages. Added to list_display in ModelAdmin, you can see that it stays "-" or "0". Only after adding new pages, these "0" change to "1" possibly. Even then all pages with sort_order "0" or "1" cannot be resorted.
A possible solution could be a lookup of all pages with an undefined sort_order and if existant than prepopulate them. You know better then me where to implement this check:
pages = SomePage.objects.live().order_by('sort_order')
if pages.filter(sort_order__isnull=True).exists() or pages.filter(sort_order=0).exists():
for i, page in enumerate(pages):
page.sort_order = i
page.save()
Thanks for this package! It is working great once I solved the following hick-up.
If you add this package to an existing Wagtail site,
sort_orderwill not be populated on already existing pages. Added tolist_displayinModelAdmin, you can see that it stays "-" or "0". Only after adding new pages, these "0" change to "1" possibly. Even then all pages withsort_order"0" or "1" cannot be resorted.A possible solution could be a lookup of all pages with an undefined
sort_orderand if existant than prepopulate them. You know better then me where to implement this check: