Hi,

I am Creating an application called 'Defect Tracking System'. My
models.py contain the three fields  namely- Defect ID, Defect Status
and Defect Reported By.
I have to perform search operation based on these three fields.
ie if I specify the Defect ID it should give me the details of that
particular defect ID. If I give Defect ID and Status then it should
give me the details of that particular defect.(ie the reported by
field).

I have to perform search operation with the combination of all these 3
fields.

I could perform search operation based on the 3 fields individually
but not with the combination of any two.

My views.py is as follows. this performs search operation based on the
Defect ID.

Please suggest how to perform search operation with the combination of
defect ID and Status field.

from django.http import HttpResponse
from django.shortcuts import render_to_response
from searchscreen.search.models import SearchScreen

def first_screen(request):
    return render_to_response('first_screen.html')

def search_form(request):
    return render_to_response('search_form.html')

def search(request):
    errors = []
    if 'q' in request.GET:
        q = request.GET['q']
        if not q:
            errors.append('Enter a search term.')
        elif len(q) > 20:
            errors.append('Please enter at most 20 characters.')
        else:
            defectids = SearchScreen.objects.filter
(defect_id__icontains=q)
            return render_to_response('search_results.html',
                {'defectids': defectids, 'query': q})
    return render_to_response('search_form.html',
        {'errors': errors})
def search1(request):
    return render_to_response('link.html')



Please reply as soon as possible.


Thanks & Regards
Diti Mansata

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to