Hello

I need to be able to create a form that contains data from my
database. It also needs to have basic pagination at the bottom of the
form as there will be many records, and I would like my users to be
able to use pagination to access them (kind of like MS Access).

I can produce the form ok, and I can also do the pagination. But I
cannot do them both together ^^

Is there a way of passing the current member PK from pagination to the
form instance so that it know's what record to bind to ?

Thank you


def listing(request):
    member = Member.objects.get(pk=1)
#    paginator = Paginator(staff_list, 1)
#
#    try:
#        page = int(request.GET.get('page', '1'))
#    except ValueError:
#        page = 1
#
#    try:
#        members = paginator.page(page)
#    except (EmptyPage, InvalidPage):
#        members = paginator.page(paginator.num_pages)

    formset = MemberForm(instance=member)
    return render_to_response('list.html', {"formset": formset})

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to