@cache_page(60 * 30)
def detail(request, slug=None, year=None, month=None, day=None, id=None):
    """Show a particular episode."""
    # strip = get_object_or_404(ComicStrip, slug=slug)
    
    try:
        id = int(id)
        if year:
            year = int(year)
        if month:
            month = int(month)
        if day:
            day = int(day)
    except __HOLE__:
        raise Http404
    
    # Some old URLs only used the episode ID, even though we now consider the
    # date-based form as canonical.
    if not year:
        episode = get_object_or_404(ComicEpisode, strip__slug=slug, id=id)
    else:
        episode = get_object_or_404(ComicEpisode, strip__slug=slug, pub_date__year=year, pub_date__month=month, pub_date__day=day, id=id)
    
    try:
        previous = episode.get_previous_by_pub_date(strip__slug=slug)
    except ComicEpisode.DoesNotExist:
        previous = None
    try:
        next = episode.get_next_by_pub_date(strip__slug=slug)
    except ComicEpisode.DoesNotExist:
        next = None
    
    page = {
        'episode': episode,
        'next': next,
        'previous': previous
    }
    
    return render_to_response('comics/detail.html', page, context_instance=RequestContext(request))
dataset/ETHPy150Open albatrossandco/brubeck_cms/brubeck/comics/views.py/detail