django-scotty 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_scotty-0.1.0/PKG-INFO +150 -0
- django_scotty-0.1.0/README.md +138 -0
- django_scotty-0.1.0/pyproject.toml +18 -0
- django_scotty-0.1.0/src/django_scotty/__init__.py +11 -0
- django_scotty-0.1.0/src/django_scotty/apps.py +7 -0
- django_scotty-0.1.0/src/django_scotty/list_views/__init__.py +0 -0
- django_scotty-0.1.0/src/django_scotty/list_views/helpers.py +489 -0
- django_scotty-0.1.0/src/django_scotty/list_views/urls.py +21 -0
- django_scotty-0.1.0/src/django_scotty/templates/cotton/django_simple_table.html +8 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/base_django_tables2.html +118 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/base_django_tables2_dict.html +74 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/django_tables_filter_line.html +82 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/dummy.html +4 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/generic_detail.html +35 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/rioja_table_template.html +118 -0
- django_scotty-0.1.0/src/django_scotty/templates/django_tables2/rioja_table_template_dict.html +114 -0
- django_scotty-0.1.0/src/django_scotty/templatetags/sluguer.py +12 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: django-scotty
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Juan Manuel Schillaci
|
|
6
|
+
Author-email: Juan Manuel Schillaci <jmschillaci@gmail.com>
|
|
7
|
+
Requires-Dist: django-cotton>=2.1.3
|
|
8
|
+
Requires-Dist: django-tables2>=2.7.5
|
|
9
|
+
Requires-Dist: tablib>=3.8.0
|
|
10
|
+
Requires-Python: >=3.13
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# Django Scotty
|
|
14
|
+
|
|
15
|
+
Advanced table views for Django with filters, exports, and bulk actions.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- 🚀 **Enhanced Table Views**: Built on top of django-tables2 with additional functionality
|
|
20
|
+
- 🎯 **Filtering**: Integrated django-filters support with beautiful UI
|
|
21
|
+
- 📊 **Export to Excel**: Export table data to XLS/XLSX formats using tablib
|
|
22
|
+
- âš¡ **Bulk Actions**: Perform actions on multiple records at once
|
|
23
|
+
- 🎨 **Modern UI**: Beautiful templates using django-cotton and Bootstrap
|
|
24
|
+
- 🔧 **Customizable**: Easy to extend and customize for your needs
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install using pip:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install django-scotty
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or using uv:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv pip install django-scotty
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
1. Add `django_scotty` to your `INSTALLED_APPS`:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
INSTALLED_APPS = [
|
|
46
|
+
...
|
|
47
|
+
'django_cotton',
|
|
48
|
+
'django_tables2',
|
|
49
|
+
'django_filters',
|
|
50
|
+
'django_scotty',
|
|
51
|
+
...
|
|
52
|
+
]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. Create a table view in your `views.py`:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from django_scotty.list_views.helpers import CottonTableView
|
|
59
|
+
import django_tables2 as tables
|
|
60
|
+
from .models import YourModel
|
|
61
|
+
|
|
62
|
+
class YourModelTable(tables.Table):
|
|
63
|
+
class Meta:
|
|
64
|
+
model = YourModel
|
|
65
|
+
fields = ['field1', 'field2', 'field3']
|
|
66
|
+
|
|
67
|
+
class YourModelListView(CottonTableView):
|
|
68
|
+
model = YourModel
|
|
69
|
+
table_class = YourModelTable
|
|
70
|
+
title = 'Your Model List'
|
|
71
|
+
paginate_by = 25
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. Add to your `urls.py`:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from django.urls import path
|
|
78
|
+
from .views import YourModelListView
|
|
79
|
+
|
|
80
|
+
urlpatterns = [
|
|
81
|
+
path('your-model/', YourModelListView.as_view(), name='yourmodel-list'),
|
|
82
|
+
]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Advanced Features
|
|
86
|
+
|
|
87
|
+
### Filtering
|
|
88
|
+
|
|
89
|
+
Add a FilterSet to enable filtering:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import django_filters
|
|
93
|
+
|
|
94
|
+
class YourModelFilter(django_filters.FilterSet):
|
|
95
|
+
class Meta:
|
|
96
|
+
model = YourModel
|
|
97
|
+
fields = ['field1', 'field2']
|
|
98
|
+
|
|
99
|
+
class YourModelListView(CottonTableView):
|
|
100
|
+
model = YourModel
|
|
101
|
+
table_class = YourModelTable
|
|
102
|
+
filterset_class = YourModelFilter
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Export to Excel
|
|
106
|
+
|
|
107
|
+
Export functionality is enabled by default. Users can click the "Export to XLS" button.
|
|
108
|
+
|
|
109
|
+
### Bulk Actions
|
|
110
|
+
|
|
111
|
+
Define custom actions in your view:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from django_scotty.list_views.helpers import CottonTableView, action
|
|
115
|
+
|
|
116
|
+
class YourModelListView(CottonTableView):
|
|
117
|
+
model = YourModel
|
|
118
|
+
table_class = YourModelTable
|
|
119
|
+
|
|
120
|
+
@action(short_description="Mark as processed")
|
|
121
|
+
def mark_processed(self, request, queryset):
|
|
122
|
+
queryset.update(processed=True)
|
|
123
|
+
return self.success_message("Records marked as processed")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Requirements
|
|
127
|
+
|
|
128
|
+
- Python >= 3.8
|
|
129
|
+
- Django >= 3.2
|
|
130
|
+
- django-cotton >= 0.9.0
|
|
131
|
+
- django-tables2 >= 2.4.0
|
|
132
|
+
- tablib[xls,xlsx] >= 3.0.0
|
|
133
|
+
- django-filter >= 22.1
|
|
134
|
+
|
|
135
|
+
## Contributing
|
|
136
|
+
|
|
137
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
142
|
+
|
|
143
|
+
## Credits
|
|
144
|
+
|
|
145
|
+
Built with:
|
|
146
|
+
- [Django](https://www.djangoproject.com/)
|
|
147
|
+
- [django-tables2](https://django-tables2.readthedocs.io/)
|
|
148
|
+
- [django-filter](https://django-filter.readthedocs.io/)
|
|
149
|
+
- [django-cotton](https://django-cotton.com/)
|
|
150
|
+
- [tablib](https://tablib.readthedocs.io/)
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Django Scotty
|
|
2
|
+
|
|
3
|
+
Advanced table views for Django with filters, exports, and bulk actions.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **Enhanced Table Views**: Built on top of django-tables2 with additional functionality
|
|
8
|
+
- 🎯 **Filtering**: Integrated django-filters support with beautiful UI
|
|
9
|
+
- 📊 **Export to Excel**: Export table data to XLS/XLSX formats using tablib
|
|
10
|
+
- âš¡ **Bulk Actions**: Perform actions on multiple records at once
|
|
11
|
+
- 🎨 **Modern UI**: Beautiful templates using django-cotton and Bootstrap
|
|
12
|
+
- 🔧 **Customizable**: Easy to extend and customize for your needs
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install using pip:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install django-scotty
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or using uv:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv pip install django-scotty
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
1. Add `django_scotty` to your `INSTALLED_APPS`:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
INSTALLED_APPS = [
|
|
34
|
+
...
|
|
35
|
+
'django_cotton',
|
|
36
|
+
'django_tables2',
|
|
37
|
+
'django_filters',
|
|
38
|
+
'django_scotty',
|
|
39
|
+
...
|
|
40
|
+
]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. Create a table view in your `views.py`:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from django_scotty.list_views.helpers import CottonTableView
|
|
47
|
+
import django_tables2 as tables
|
|
48
|
+
from .models import YourModel
|
|
49
|
+
|
|
50
|
+
class YourModelTable(tables.Table):
|
|
51
|
+
class Meta:
|
|
52
|
+
model = YourModel
|
|
53
|
+
fields = ['field1', 'field2', 'field3']
|
|
54
|
+
|
|
55
|
+
class YourModelListView(CottonTableView):
|
|
56
|
+
model = YourModel
|
|
57
|
+
table_class = YourModelTable
|
|
58
|
+
title = 'Your Model List'
|
|
59
|
+
paginate_by = 25
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
3. Add to your `urls.py`:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from django.urls import path
|
|
66
|
+
from .views import YourModelListView
|
|
67
|
+
|
|
68
|
+
urlpatterns = [
|
|
69
|
+
path('your-model/', YourModelListView.as_view(), name='yourmodel-list'),
|
|
70
|
+
]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Advanced Features
|
|
74
|
+
|
|
75
|
+
### Filtering
|
|
76
|
+
|
|
77
|
+
Add a FilterSet to enable filtering:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import django_filters
|
|
81
|
+
|
|
82
|
+
class YourModelFilter(django_filters.FilterSet):
|
|
83
|
+
class Meta:
|
|
84
|
+
model = YourModel
|
|
85
|
+
fields = ['field1', 'field2']
|
|
86
|
+
|
|
87
|
+
class YourModelListView(CottonTableView):
|
|
88
|
+
model = YourModel
|
|
89
|
+
table_class = YourModelTable
|
|
90
|
+
filterset_class = YourModelFilter
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Export to Excel
|
|
94
|
+
|
|
95
|
+
Export functionality is enabled by default. Users can click the "Export to XLS" button.
|
|
96
|
+
|
|
97
|
+
### Bulk Actions
|
|
98
|
+
|
|
99
|
+
Define custom actions in your view:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from django_scotty.list_views.helpers import CottonTableView, action
|
|
103
|
+
|
|
104
|
+
class YourModelListView(CottonTableView):
|
|
105
|
+
model = YourModel
|
|
106
|
+
table_class = YourModelTable
|
|
107
|
+
|
|
108
|
+
@action(short_description="Mark as processed")
|
|
109
|
+
def mark_processed(self, request, queryset):
|
|
110
|
+
queryset.update(processed=True)
|
|
111
|
+
return self.success_message("Records marked as processed")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Requirements
|
|
115
|
+
|
|
116
|
+
- Python >= 3.8
|
|
117
|
+
- Django >= 3.2
|
|
118
|
+
- django-cotton >= 0.9.0
|
|
119
|
+
- django-tables2 >= 2.4.0
|
|
120
|
+
- tablib[xls,xlsx] >= 3.0.0
|
|
121
|
+
- django-filter >= 22.1
|
|
122
|
+
|
|
123
|
+
## Contributing
|
|
124
|
+
|
|
125
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
130
|
+
|
|
131
|
+
## Credits
|
|
132
|
+
|
|
133
|
+
Built with:
|
|
134
|
+
- [Django](https://www.djangoproject.com/)
|
|
135
|
+
- [django-tables2](https://django-tables2.readthedocs.io/)
|
|
136
|
+
- [django-filter](https://django-filter.readthedocs.io/)
|
|
137
|
+
- [django-cotton](https://django-cotton.com/)
|
|
138
|
+
- [tablib](https://tablib.readthedocs.io/)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "django-scotty"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Juan Manuel Schillaci", email = "jmschillaci@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.13"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"django-cotton>=2.1.3",
|
|
12
|
+
"django-tables2>=2.7.5",
|
|
13
|
+
"tablib>=3.8.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[build-system]
|
|
17
|
+
requires = ["uv_build>=0.9.1,<0.10.0"]
|
|
18
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Django Scotty - Advanced Table Views for Django
|
|
3
|
+
================================================
|
|
4
|
+
|
|
5
|
+
A Django app that provides enhanced table views with filters, exports, and actions
|
|
6
|
+
using django-tables2, django-filters, and django-cotton.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = '0.1.0'
|
|
10
|
+
|
|
11
|
+
default_app_config = 'django_scotty.apps.DjangoScottyConfig'
|
|
File without changes
|