launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #13581
Re: lp:~dimitern/maas/bug-994887-nodes-listing-does-not-support-sorting into lp:maas
It works quite well with paging - transparently, and because it modifies the queryset, it actually works for both visible and invisible nodes in the list. Paging links include the ?sort= and dir= parameters, so sorting spans pages properly. I tested this manually by setting paginate_by = 2, and then realized it'll be good to have a test for that. So I added test_node_list_paginates_while_sorted, which does just that.
Also, I noticed a small omission on my part - the tags view shows matching nodes in a list, using the same template, so I modified the included snippet to skip header paging links when not explicitly required (only /nodes/ list uses it now).
With regards to speed, I don't think it'll be any slower than sorting by -created by default, provided we have indexes on both hostname and status columns in the DB. I thought about implementing the sort using AJAX/in-line with JS, but what I did seemed like a better option.
Thanks for the feedback and I'm eager to see the review :)
--
https://code.launchpad.net/~dimitern/maas/bug-994887-nodes-listing-does-not-support-sorting/+merge/130600
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~dimitern/maas/bug-994887-nodes-listing-does-not-support-sorting into lp:maas.
References