wagtail-nest / wagtail-modeladmin

Add any model in your project to the Wagtail admin. Formerly wagtail.contrib.modeladmin.
Other
22 stars 8 forks source link

Ordering on models based on Page model doesn't work correctly #23

Open bplociennik opened 4 years ago

bplociennik commented 4 years ago

Issue Summary

There is a small issue with the ordering list for the models based on the Page model.

When you want to order on more than one field then the recently clicked column is present in order query param as the first not as the second.

Another behavior is on the basic models (ModelAdmin). When we choose second column to filter the order of that ids in the o query param is correct.

Page listing with one field to order: /admin/properties/propertypage/?o=0

Page listing with two fields to order: /admin/properties/propertypage/?o=2.0

Excepted result (from the model admin listing): /admin/properties/propertypage/?o=0.2

Steps to Reproduce

  1. go to the listing for any model inherits from Page model
  2. click to sort by the first column
  3. after reloading choose another column to sort as the second sorting
  4. sorting works by second column firstly then for the first column

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

Expected Result

Technical details