hi,

I am trying to put a page list for a search result. So far here's what
I've try by using the django.views.generic.list_detail.object_list and
the pagination tag (http://code.djangoproject.com/wiki/PaginatorTag)
and later found out that it won't meet my needs.

def search_employee(request):
    if not request.GET:
        return render_to_response('search_employee.htm')
    else:
        params = request.GET['name'].split()
        employees = Employee.objects.all()
        for p in params:
            employees = employees.filter(Q(firstname = p) | Q(lastname
= p))
        return object_list(request, employees, paginate_by=3,
template_name='search_employee_result.htm',
template_object_name='employee')

This won't work because when you try to select other page the
query_set from previous is lost ... I am thinking off passing the
request.GET to the object_list's extra_context argument, then edit the
pagination tag that will provide link constrcuted from the
extra_context?

Or is there a better solution or existing solution?

Thanks
james


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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