django-admin-inline-paginator
django-admin-inline-paginator copied to clipboard
StackedInline and collapse bug
Hi! It worked as expected, thanks for the project! I only wanted to know if this pagination could be used with StackedInline instead of TabularInline. This would be perfect for my project.
Also, I don't know if it is a know bug but when you use classes=['collapse'] on the inline, the page numbers doesn't collapse, they keep out of it.
I managed to add pagination to StackedInline by doing this
class YourAdminInline(InlinePaginated, admin.StackedInline):
model = YourModel
per_page = 10
template = f'{BASE_DIR}/templates/stacked_paginated.html' #path to your template
And then go to your template folder and create stacked_paginated.html like this:
{% include 'admin/edit_inline/stacked.html' %}
<div class="admin-tabular-inline-pagination">
{% include 'admin/tabular_paginator.html' %}
</div>