django-admin-inline-paginator icon indicating copy to clipboard operation
django-admin-inline-paginator copied to clipboard

StackedInline and collapse bug

Open P3RI9 opened this issue 3 years ago • 2 comments

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. image

P3RI9 avatar Feb 24 '22 09:02 P3RI9

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>

MrMika96 avatar Sep 15 '23 09:09 MrMika96