def entry_detail(request, date, slug):
    """Display one entry with the given slug and date.
    """
    try:
        today = datetime.strptime(date, "%Y/%b/%d")
        tomorrow = today + timedelta(days=1)
    except:
        raise Http404

    try:
        entry = EntryType.objects(publish_date__gte=today, 
                                  publish_date__lt=tomorrow, slug=slug)[0]
    except IndexError:
        raise Http404

    # Select correct form for entry type
    form_class = Comment.CommentForm

    if request.method == 'POST':
        form = form_class(request.user, request.POST)
        if form.is_valid():
            # Get necessary post data from the form
            comment = HtmlComment(**form.cleaned_data)
            if request.user.is_authenticated():
                comment.is_admin = True
            # Update entry with comment
            q = EntryType.objects(id=entry.id)
            comment.rendered_content = markup(comment.body, escape=True,
                                              small_headings=True)
            q.update(push__comments=comment)

            return HttpResponseRedirect(entry.get_absolute_url()+'#comments')
    else:
        form = form_class(request.user)

    # Check for comment expiry
    comments_expired = False
    if entry.comments_expiry_date:
        if entry.comments_expiry_date < datetime.now():
            comments_expired = True

    context = {
        'entry': entry,
        'form': form,
        'comments_expired': comments_expired,
    }
    return render_to_response(_lookup_template('entry_detail'), context,
                              context_instance=RequestContext(request))
dataset/ETHPy150Open hmarr/django-mumblr/mumblr/views/core.py/entry_detail/original