well, I've looked into it more, and it seems that the max_num argument to the modelformset_factory constructor is the best way to go. If it works i'll post it here for those who might find this thread from google.
On Nov 25, 8:46 pm, Some Guy <djul...@gmail.com> wrote: > I'm having an issue trying to create pagination with a modelformset. > so far I have... > > SubFormSet = modelformset_factory(Submission, can_delete=True, > extra=0, form=PricingForm) > ... > objs = Submission.objects.all() > formset = SubFormSet(queryset=objs) <-overriding the basic > queryset > groups = map(None, objs, formset.forms) <- I need both the objects > and the forms, iterating over them together in the view > paginator = Paginator(groups, 10) <-- standard paginator > this_page = paginator.page(ppage) > ...then render > > so, basically, this works for viewing, but submitting doesn't work > because the management form values (INITIAL_FORMS, FORM_COUNT, etc) > are wrong, they still hold the values of the whole queryset. I tried > feeding the formset constructor the object_list from the paginiator, > but that fails, complaining about "is_ordered" not being there.So my > considerations are to... > > 1.Change the management form values with js (scary at best) > 2.Slice the queryset (seems like i'd have to duplicate all the > pagination in my code) > 3.Try to overwrite the management_form values directly. > 4.Set the max_num attribute of the model_formset > 5.beg for help on the mailing list. :) > > Anyone have any guidance as to which might be best option? Anyone ever > done this? > TIA -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.