The is a view I have to search some of my models: def search(request): query = request.GET.get("s", "") q = Q() for term in query.split(): q |= Q(abstract__icontains=term) | Q(next_field__icontains=term) results = [i for i in itertools.chain(DataSet1.objects.filter(q), DataSet2.objects.filter(q))] results = sorted(results, key=operator.attrgetter('abstract')) return render_to_response('/search.html', {'query': query, 'results': results}, context_instance = RequestContext(request))
The Q objects contain your query fields. The results iteration contains your models. R. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---