Skip to content

Commit 5143265

Browse files
committed
Add note about django-tables2 in README
1 parent 8b1b296 commit 5143265

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ data tables. You don't need to change anything to your views to use it. It
77
provides sorting links for table headers. It is the perfect companion of
88
[django-pagination](https://github.com/zyga/django-pagination).
99

10+
There are other powerful projects to sort tables such as
11+
[django-tables2](https://django-tables2.readthedocs.io/) but I don't like the
12+
high level `render_table` tag because it requires to define the CSS in
13+
`Table` classes or to write custom templates.
14+
1015
A demonstration of the features is provided in `testproj` directory.
1116

1217
## Features
@@ -24,9 +29,15 @@ To upgrade to `webstack-django-sorting` v1.0.0+, you must remove the old middlew
2429

2530
## How to use it in your project
2631

27-
1. `pip install webstack_django_sorting`
32+
The provide is available on PyPI:
33+
34+
pip install webstack_django_sorting
35+
36+
The project provides examples of integration with Django and Jinja2 templates.
37+
38+
## For Django templates
2839

29-
2. Add the application to the `INSTALLED_APPS` list:
40+
1. Add the application to the `INSTALLED_APPS` list:
3041

3142
```python
3243
INSTALLED_APPS = [
@@ -35,11 +46,7 @@ To upgrade to `webstack-django-sorting` v1.0.0+, you must remove the old middlew
3546
]
3647
```
3748

38-
The project provides examples of integration with Django and Jinja2 templates.
39-
40-
## For Django templates
41-
42-
1. Check the request context processor is loaded in `TEMPLATES` options:
49+
2. Check the request context processor is loaded in `TEMPLATES` options:
4350

4451
```python
4552
TEMPLATES = [
@@ -58,16 +65,16 @@ The project provides examples of integration with Django and Jinja2 templates.
5865
]
5966
```
6067

61-
2. Add this line at the top of your template to load the sorting tags:
68+
3. Add this line at the top of your template to load the sorting tags:
6269

6370
{% load sorting_tags %}
6471

65-
3. Decide on a variable that you would like to sort, and use the
72+
4. Decide on a variable that you would like to sort, and use the
6673
autosort tag on that variable before iterating over it:
6774

6875
{% autosort object_list %}
6976

70-
4. Now, you want to display different headers with links to sort
77+
5. Now, you want to display different headers with links to sort
7178
your objects_list:
7279

7380
```html

0 commit comments

Comments
 (0)