articles/views.py
def detail(request, article_id):
    """
    Handle detail view for an article
    """
    # Quite simple, set up article and form
    form = CIFArticleForm()
    article_key = 'cim:article:%s' % article_id
    article = cache.get(article_key)
    if article is None:
        article = get_object_or_404(CIFArticle, id=article_id)
        cache.set(article_key, article, 300)

    return render(request, 'articles/detail.html', {
        'article' : article,
        'form' : form })

    Handle detail view for an article
    
Handle detail view for an article
Handle detail view for an article
def detail(request, article_id):
    form = CIFArticleForm()
    article_key = 'cim:article:%s' % article_id
    article = cache.get(article_key)
    if article is None:
        article = get_object_or_404(CIFArticle, id=article_id)
        cache.set(article_key, article, 300)
    return render(request, 'articles/detail.html', {
        'article' : article,
        'form' : form })
def detail ( request , article_id ) : form = CIFArticleForm ( ) article_key = 'cim:article:%s' % article_id article = cache . get ( article_key ) if article is None : article = get_object_or_404 ( CIFArticle , id = article_id ) cache . set ( article_key , article , 300 ) return render ( request , 'articles/detail.html' , { 'article' : article , 'form' : form } )
Handle detail view for an article
Handle detail view for an article
"""
    Handle detail view for an article
    """ # Quite simple, set up article and form
request
article_id