<commit_before>from django.db.models import Q
from django.shortcuts import render_to_response
from django.template import RequestContext 

from grid.models import Grid
from package.models import Package

from searchv1.forms import SearchForm


def search(request, template_name='searchv1/search.html'):
    """
    Searches in Grids and Packages
    """
    grids = []
    packages = []
    q = request.GET.get('q', '')
    if q:
        packages = Package.objects.filter(Q(title__icontains=q) | Q(repo_description__icontains=q))
        grids    = Grid.objects.filter(Q(title__icontains=q) | Q(description__icontains=q))
        
    form = SearchForm(request.GET or None)
        
    return render_to_response(template_name, {<commit_msg>searchv1 title searches now skip django<commit_after>from django.db.models import Q
from django.shortcuts import render_to_response
from django.template import RequestContext 

from grid.models import Grid
from package.models import Package

from searchv1.forms import SearchForm


def search(request, template_name='searchv1/search.html'):
    """
    Searches in Grids and Packages
    """
    grids = []
    packages = []
    q = request.GET.get('q', '')
    if q:
        django_dash = 'django-%s' % q
        django_space = 'django %s' % q                
        packages = Package.objects.filter(
                    Q(title__icontains=q) | 
                    Q(title__istartswith=django_dash) |
                    Q(title__istartswith=django_space) |                    
                    Q(repo_description__icontains=q))        
        grids    = Grid.objects.filter(Q(title__icontains=q) | Q(description__icontains=q))
        
    form = SearchForm(request.GET or None)
        
    return render_to_response(template_name, {
{'fraction_non_alphanumeric': 0.09248878923766816, 'fraction_numerical': 0.002802690582959641, 'mean_word_length': 2.7343096234309625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3842863', 'n_tokens_mistral': 534, 'n_tokens_neox': 520, 'n_words': 115}