The 'Django Admin Inline Paginator Plus' is simple way to paginate your inlines in Django admin
Project description
Django Admin Inline Paginator Plus ⏩
🍴 This is a forked and updated version based on original library django-admin-inline-paginator.
As for 10.07.2024 nobody took responsibility, so I decided to take it since we need additional functionlity like AJAX for pagination.
The "Django Admin Inline Paginator Plus" is simple way to paginate your inline in django admin
To keep Django ecosystem fresh and updated, please share your love and support, click Star
🫶
Features
- Easy Inline Pagination: Quickly paginate inlines in the Django admin.
- AJAX Support: Smooth and dynamic pagination without page reloads with
htmx
. - Multiple Inline Pagination: Manage multiple paginated inlines seamlessly.
Here's a screenshot of the paginated inlines in action:
Install:
Install the package via pip:
pip install django-admin-inline-paginator-plus
Usage:
-
Add to your INSTALLED_APPS, in settings.py:
INSTALLED_APPS = [ ... 'django_admin_inline_paginator_plus', ... ]
-
Create your model inline:
You can use
TabularInlinePaginated
otStackedInlinePaginated
. In our example we useTabularInlinePaginated
.from django_admin_inline_paginator_plus.admin import TabularInlinePaginated class ModelWithFKAdminInline(TabularInlinePaginated): model = ModelWithFK fields = (...) per_page = 5
-
Create main model admin and use inline:
@register(YourModel) class YourModelAdmin(ModelAdmin): model = YourModel fields = (...) inlines = (ModelWithFKAdminInline, )
Advanced Usage:
-
Paginate multiples inlines:
from django_admin_inline_paginator_plus.admin import TabularInlinePaginated, StackedInlinePaginated class ModelWithFKInline(TabularInlinePaginated): model = ModelWithFK fields = ('name', 'active') per_page = 2 pagination_key = 'page-model' # make sure it's unique for page inline class AnotherModelWithFKInline(StackedInlinePaginated): model = AnotherModelWithFK fields = ('name', 'active') per_page = 2 pagination_key = 'page-another-model' # make sure it's unique for page inline
-
Use inlines from step 1. and add to your main model admin:
@register(YourModel) class YourModelAdmin(ModelAdmin): model = YourModel fields = (...) inlines = (ModelWithFKAdminInline, AnotherModelWithFKInline)
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
File details
Details for the file django_admin_inline_paginator_plus-0.1.1.tar.gz
.
File metadata
- Download URL: django_admin_inline_paginator_plus-0.1.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e493902948123a7c34ab4e7d966b5d73e540e8f876377e14ec209be0044b503b |
|
MD5 | d3b61cf91a511b2f24cf512edd4931fa |
|
BLAKE2b-256 | c9a1c2beb736c7ebf9c2fd39c94d6d6f73a2015ab0d03fe79f3818c96abef334 |
File details
Details for the file django_admin_inline_paginator_plus-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_admin_inline_paginator_plus-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 716167424bea941ee0666047f0e7e3da71701f85a025343fe3fb7a75ad68bd0d |
|
MD5 | bf084d00521fc45a70cd119d465fc14b |
|
BLAKE2b-256 | 31badd53aa348eb5cc69b7b826a7546e857b28778b3b6c91ae14f8e2a78fd11c |