A collection of Django utils
Project description
# IS Django Utils
Django Utils is a collection of utils for Django.
## Quick start
1. Add "django-utils" to your INSTALLED_APPS setting like this:
```
INSTALLED_APPS = [
...
'django_utils',
...
]
```
## AdminWithSelectRelated
- Usage:
```
from django_utils.admin import AdminWithSelectRelated
class AlumnoAdmin(AdminWithSelectRelated):
list_display = ('estudiante', 'seccion', 'anio_lectivo', )
list_filter = (
('seccion', SeccionFilter),
'seccion__grado__anio_lectivo',
)
inlines = (AlumnoServicioInlineAdmin, AlumnoItemInlineAdmin, )
list_select_related = ('estudiante__profile', 'seccion__grado__anio_lectivo', )
```
## AdminInlineWithSelectRelated
- Usage:
```
from django_utils.admin import AdminInlineWithSelectRelated
class AlumnoItemInlineAdmin(AdminInlineWithSelectRelated):
model = AlumnoItem
list_select_related = ('alumno__estudiante__profile', 'item__anio_lectivo', )
```
## FilterWithSelectRelated
```
from django_utils.admin import FilterWithSelectRelated
class SeccionFilter(FilterWithSelectRelated):
list_select_related = ('grado', )
```
Django Utils is a collection of utils for Django.
## Quick start
1. Add "django-utils" to your INSTALLED_APPS setting like this:
```
INSTALLED_APPS = [
...
'django_utils',
...
]
```
## AdminWithSelectRelated
- Usage:
```
from django_utils.admin import AdminWithSelectRelated
class AlumnoAdmin(AdminWithSelectRelated):
list_display = ('estudiante', 'seccion', 'anio_lectivo', )
list_filter = (
('seccion', SeccionFilter),
'seccion__grado__anio_lectivo',
)
inlines = (AlumnoServicioInlineAdmin, AlumnoItemInlineAdmin, )
list_select_related = ('estudiante__profile', 'seccion__grado__anio_lectivo', )
```
## AdminInlineWithSelectRelated
- Usage:
```
from django_utils.admin import AdminInlineWithSelectRelated
class AlumnoItemInlineAdmin(AdminInlineWithSelectRelated):
model = AlumnoItem
list_select_related = ('alumno__estudiante__profile', 'item__anio_lectivo', )
```
## FilterWithSelectRelated
```
from django_utils.admin import FilterWithSelectRelated
class SeccionFilter(FilterWithSelectRelated):
list_select_related = ('grado', )
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for inspired-django-utils-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e4e00af939993180a89f5200bfa5eb0690f6e1c6a825fea010d7debe6dda26d |
|
MD5 | 9611fc96efc8cbbc608f7621b038bb87 |
|
BLAKE2b-256 | d30bd3b9e03731bc187ecf8ec60834dd40d47c4f87a4e4a19f7c51b03b52dc00 |
Close
Hashes for inspired_django_utils-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1997a62d8d30dcc04df024cc16add25d1677040884840de9c839d6f1b9929da1 |
|
MD5 | 1b6b1117799b3ad0c92128a9dfcf5b68 |
|
BLAKE2b-256 | f479a76ed63c9a0c7a5f88455fcfa092b3f32b1b682252de821192d789386743 |