make an order by or sort by

how can i make an order by when we clic in the title, bellow the screen for exemple when we clic in the machine title we can order by machine.

Do you want this done by sending a new request to the server to reload the page, or are you looking to do this in the client via JavaScript?

really i don’t know what is the best solution

There is no “best”, just tradeoffs between the two.

For example, if you do it server-side, then each sort is going to re-read whatever data is being displayed and so can show updated data each time you select a column. Now, whether or not you consider that “good” is something only you can determine.

(That’s only one example of the type of tradeoffs involved - there are a number of others.)

for my exemple i need send a new request to the server to get updated data, but how can I do that

One resource when looking for examples or ideas of specific ways to do things is djangopackages.org.

In this case, searching for “sort” gives Django Packages : Sortable ListView as one of the solutions.

I have no idea whether this package is specifically useful to you or not, but even if it’s not, you might get some ideas from reading the code and docs for it.

ok thanks a lot for your help