Paginating 31 forms in to multiple pages( 16 forms per page)

21 views
Skip to first unread message

wangolo joel

unread,
Oct 20, 2014, 9:11:08 AM10/20/14
to django...@googlegroups.com
I have a  lot of form(31) am looking for a way to divide them into multiple pages but current I seem not to find any way of doing this.
All the other pagination  methods seem to favour those displaying data not those displaying forms.
Am using class based view(View)

DataInputProcessor(View):
     def get(self, request, dataset):
          #The source is way to much to post here.

     #after all forms in the pages have been filled post
     def post(self, request, dataset):
          #Allthis works for me but, how I can divide the forms in multiple pages not one.

Every thing seems to work for me inputing forms and posting all works, but the forms are too many And I
don't want the user to scroll the page until.

Collin Anderson

unread,
Oct 20, 2014, 6:02:29 PM10/20/14
to django...@googlegroups.com
Hi,

Are you using model formsets? Would something like this might work?

page = Paginate(queryset, 16).page(request.GET.get('page') or 1)
formset = MyFormSet(queryset=page.object_list)

Collin


Reply all
Reply to author
Forward
0 new messages