Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relations: configuring pagination #1445

Open
gythaogg opened this issue Nov 25, 2024 · 2 comments
Open

relations: configuring pagination #1445

gythaogg opened this issue Nov 25, 2024 · 2 comments
Labels
feature Enhancement of existing functionality or new feature

Comments

@gythaogg
Copy link
Contributor

We can configure the pagination size of list views by setting paginate_by in for the table for list views.

In the detail view of an entity, (new) relations are paginated and we can modify the page size here by

  1. adding a per_page parameter in the URL
    or
  2. adding a per_page attribute to the Meta class of the EntityRelationsTable

It would be nice to have a uniform configuration method - either per_page in Meta class or paginate_by as an attribute of the table class for tables everywhere in APIS

@gythaogg gythaogg added the feature Enhancement of existing functionality or new feature label Nov 25, 2024
@b1rger
Copy link
Contributor

b1rger commented Nov 29, 2024

I'd suggest to drop the paginate_by attribute. The Meta.per_page attribute is part of django-tables2. I did not know that this Meta attribute exists when I introduced the paginate_by setting. I think it makes more sense to use the upstream solution than a custom one.

@gythaogg
Copy link
Contributor Author

gythaogg commented Nov 29, 2024

If I recall correctly, the Meta.per_page didn't work for the ListViews - (but it worked when I passed per_page via the request params in the query string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Enhancement of existing functionality or new feature
Projects
None yet
Development

No branches or pull requests

2 participants