R
R
RabbitRun92021-05-14 18:50:55
Django
RabbitRun9, 2021-05-14 18:50:55

Sorting table fields in django project?

Good afternoon. There is TK. Help to orient.
I did a Django project, created the necessary fields for the table in the model.


1) The table should contain 4 columns:
name, date, and 2 columns of numbers.

2) The table must be sorted by all fields except the date.
Filtering should be in the form of two drop-down lists and a text field:
a) Selecting a column by which to filter
b) Selecting a condition (equal to, contains, greater than, less than)
c) A field for entering a value for filtering

3) The table must contain pagination

The entire table should work without reloading the page.


From point 2, I began to misunderstand. As I understand it, this should be done on the front, and using the css library (or the capabilities of python). I do not exclude the use of React / Axios, Vue, but I have not yet come across these technologies in my work.
The whole table should work without reloading the page. What is the best way to do this with ajax? Or is React/Vue better?
Maybe someone did something similar, I will be grateful for the help and if you share ideas, code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maksam07, 2021-05-16
@maksam07

2. https://pypi.org/project/django-filter/
But this is without ajax

The whole table should work without reloading the page. What is the best way to do this with ajax? Or is React/Vue better?
I think both there and there, the same methods are used - sending a request to the server and receiving a response
From simple: https://api.jquery.com/jquery.ajax/
In general, the usual html + css + js is enough (without libraries) + filtering processing on the back

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question