<commit_before>from django.shortcuts import render, get_object_or_404

from .models import Sponsor


def list_sponsors(request):
    sponsors = Sponsor.objects.all()
    return render(request, 'sponsors/list_sponsors.html', {'sponsors': sponsors})


def view_sponsor(request, slug):
    sponsor = get_object_or_404(Sponsor, slug=slug)
    return render(request, 'sponsors/view_sponsor.html', {'sponsor': sponsor})

<commit_msg>Adds jobs for sponsor detail view<commit_after>from django.shortcuts import render, get_object_or_404

from jobs.models import Job

from .models import Sponsor


def list_sponsors(request):
    sponsors = Sponsor.objects.all()
    return render(request, 'sponsors/list_sponsors.html', {'sponsors': sponsors})


def view_sponsor(request, slug):
    sponsor = get_object_or_404(Sponsor, slug=slug)
    jobs = Job.objects.filter(sponsor=sponsor)
    return render(request, 'sponsors/view_sponsor.html', {
        'sponsor': sponsor,
        'jobs': jobs})


{'fraction_non_alphanumeric': 0.1111111111111111, 'fraction_numerical': 0.012232415902140673, 'mean_word_length': 5.061728395061729, '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': '3990851', 'n_tokens_mistral': 359, 'n_tokens_neox': 314, 'n_words': 71}