Django

Code

Changeset 2867

Show
Ignore:
Timestamp:
05/08/06 16:59:37 (2 years ago)
Author:
adrian
Message:

Fixed #1811 -- Fixed some inconsistencies in docs/overview.txt. Thanks, quarkcool@yahoo.fr

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/overview.txt

    r2809 r2867  
    184184 
    185185For example, if a user requested the URL "/articles/2005/05/39323/", Django 
    186 would call the function ``myproject.news.views.article_detail(request, 
     186would call the function ``mysite.news.views.article_detail(request, 
    187187'2005', '05', '39323')``. 
    188188 
     
    200200    def year_archive(request, year): 
    201201        a_list = Article.objects.filter(pub_date__year=year) 
    202         return render_to_response('news/year_archive.html', {'article_list': a_list}) 
     202        return render_to_response('news/year_archive.html', {'year': year, 'article_list': a_list}) 
    203203 
    204204This example uses Django's template system, which has several powerful 
     
    220220    {% extends "base.html" %} 
    221221 
    222     {% block title %}{{ article.headline }}{% endblock %} 
     222    {% block title %}Articles for {{ year }}{% endblock %} 
    223223 
    224224    {% block content %} 
    225     <h1>{{ article.headline }}</h1> 
    226     <p>By {{ article.get_reporter.full_name }}</p> 
     225    <h1>Articles for {{ year }}</h1> 
     226 
     227    {% for article in article_list %} 
     228    <p>{{ article.headline }}</p> 
     229    <p>By {{ article.reporter.full_name }}</p> 
    227230    <p>Published {{ article.pub_date|date:"F j, Y" }}</p> 
    228     {{ article.article }
     231    {% endfor %
    229232    {% endblock %} 
    230233