|
1 | 1 | [](https://pepy.tech/project/django-query-to-table) |
2 | 2 |
|
3 | | -### django-query-to-table (DjangoQtt) is an easy to use django package to generate html table from sql query. |
| 3 | +### django-query-to-table (DjangoQtt) is an easy to use django package to generate html table from django queryset or sql query. |
4 | 4 |
|
5 | 5 | You can read more about this package here : [django query to table package](https://mshaeri.com/blog/generate-html-table-report-from-sql-query-in-django/) |
6 | 6 |
|
7 | | -The package contains two functions named: |
| 7 | +The package has two functions, named: |
8 | 8 | - **generate_from_sql**: Generate HTML table by given SQL query |
9 | 9 | - **generate_from_queryset**:Generate HTML table by given Django queryset |
10 | 10 |
|
11 | | -Parameters: |
| 11 | +Parameters and options: |
12 | 12 |
|
13 | 13 | * title : The title of the report that will be shown on top of table |
14 | 14 | * sqltext/queryset : The sql select query to retrieve data / django queryset |
@@ -60,10 +60,12 @@ def listOfPersons(request): |
60 | 60 |
|
61 | 61 | ``` |
62 | 62 |
|
63 | | -Since Django 4.0.4 introduced a security fix that disallows spaces in aliases, you can use double underscores (__) as a substitute in your aliases. The table generator will automatically display them as spaces in the output. Here's an example: |
64 | | - |
65 | 63 | - Generate HTML table from querset: |
66 | 64 |
|
| 65 | +> Since Django 4.0.4 introduced a security fix that disallows spaces in aliases, you can use double underscores (__) as a substitute in your aliases. The table generator will automatically display them as spaces in the output. Here's an example: |
| 66 | +
|
| 67 | + |
| 68 | + |
67 | 69 | ```python |
68 | 70 | from django_query_to_table import DjangoQtt |
69 | 71 | from django.http import HttpResponse |
@@ -102,4 +104,7 @@ def listOfPersons(request): |
102 | 104 |
|
103 | 105 | The table will be look like this: |
104 | 106 |
|
105 | | -  |
| 107 | +  |
| 108 | + |
| 109 | + |
| 110 | +If you find this package useful, please consider giving it a star! ⭐ It helps support the project and lets others discover it. |
0 commit comments