Opened 5 years ago

Closed 5 years ago

#30632 closed New feature (wontfix)

Pagination for FormSet

Reported by: Parth Patil Owned by: Parth Patil
Component: Forms Version: 2.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Having pagination directly built into FormSet will really be a nice shortcut for users. This will enable people to use formset with more versatility. For e.g. can benefit from this.

Change History (7)

comment:1 by Parth Patil, 5 years ago

Has patch: set
Owner: changed from nobody to Parth Patil
Status: newassigned

Here is a PR for the new feature
https://github.com/django/django/pull/11558

comment:2 by Mariusz Felisiak, 5 years ago

Can you describe the use case and your motivation? I'm not sure how it would work. "Normally" you will lose all entered data after changing a page.

in reply to:  2 comment:3 by Parth Patil, 5 years ago

Replying to felixxm:

Can you describe the use case and your motivation? I'm not sure how it would work. "Normally" you will lose all entered data after changing a page.

I intended it to be used for model formsets. Mostly for e.g. blog sites if there are 100 blog models on can easily have it paginated and well formatted using formsets while also selecting which fields to show.

comment:4 by Mariusz Felisiak, 5 years ago

I don't see any benefit in using a paginated formset in this scenario, because you will be able to work only on a single page i.e. only with a subset of forms from formset. It's not necessary to create formset with 100 forms to use only 10 of them. You should rather paginate a queryset and create formset for a single page.

comment:5 by Carlton Gibson, 5 years ago

Hey Parth.

Mostly for e.g. blog sites if there are 100 blog models…

In this case don’t you paginate the queryset prior to creating the FormSet?

in reply to:  4 comment:6 by Parth Patil, 5 years ago

Replying to felixxm:

because you will be able to work only on a single page i.e. only with a subset of forms from formset.

I agree with that, but I meant this feature to be more as a method of representation of data rather than taking input from the user.

Replying to Carlton Gibson:

In this case don’t you paginate the queryset prior to creating the FormSet?

I guess I'm thinking of a very specific example where the queryset is itself large enough, like a blog having over 100 replies.


It's more like I see this being useful if used with models, this will give a quick way of representing different models using formsets, where even the queryset is large enough.

comment:7 by Carlton Gibson, 5 years ago

Resolution: wontfix
Status: assignedclosed

Hey Parth. I think we need to pin down the use-case before moving forward with this. Let's do that on the email.

Note: See TracTickets for help on using tickets.
Back to Top