Changeset 2867
- Timestamp:
- 05/08/06 16:59:37 (2 years ago)
- Files:
-
- django/trunk/docs/overview.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/overview.txt
r2809 r2867 184 184 185 185 For example, if a user requested the URL "/articles/2005/05/39323/", Django 186 would call the function ``my project.news.views.article_detail(request,186 would call the function ``mysite.news.views.article_detail(request, 187 187 '2005', '05', '39323')``. 188 188 … … 200 200 def year_archive(request, year): 201 201 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}) 203 203 204 204 This example uses Django's template system, which has several powerful … … 220 220 {% extends "base.html" %} 221 221 222 {% block title %} {{ article.headline}}{% endblock %}222 {% block title %}Articles for {{ year }}{% endblock %} 223 223 224 224 {% 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> 227 230 <p>Published {{ article.pub_date|date:"F j, Y" }}</p> 228 { { article.article }}231 {% endfor %} 229 232 {% endblock %} 230 233
