diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-05-08 21:59:37 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-05-08 21:59:37 +0000 |
| commit | f0141f1c1c17bad4e1fd9bb922c92d23f97ad4b2 (patch) | |
| tree | 56b5dd6ce38ea2df1b6a0030367c3fe3d74dc5f3 | |
| parent | 8e441e9c5a792e225be683fd0ec8cdfb709ce91a (diff) | |
Fixed #1811 -- Fixed some inconsistencies in docs/overview.txt. Thanks, quarkcool@yahoo.fr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/overview.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/overview.txt b/docs/overview.txt index 544a897ac6..75e324aa57 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -183,7 +183,7 @@ is a simple Python function. Each view gets passed a request object -- which contains request metadata -- and the values captured in the regex. For example, if a user requested the URL "/articles/2005/05/39323/", Django -would call the function ``myproject.news.views.article_detail(request, +would call the function ``mysite.news.views.article_detail(request, '2005', '05', '39323')``. Write your views @@ -199,7 +199,7 @@ and renders the template with the retrieved data. Here's an example view for def year_archive(request, year): a_list = Article.objects.filter(pub_date__year=year) - return render_to_response('news/year_archive.html', {'article_list': a_list}) + return render_to_response('news/year_archive.html', {'year': year, 'article_list': a_list}) This example uses Django's template system, which has several powerful features but strives to stay simple enough for non-programmers to use. @@ -219,13 +219,16 @@ might look like:: {% extends "base.html" %} - {% block title %}{{ article.headline }}{% endblock %} + {% block title %}Articles for {{ year }}{% endblock %} {% block content %} - <h1>{{ article.headline }}</h1> - <p>By {{ article.get_reporter.full_name }}</p> + <h1>Articles for {{ year }}</h1> + + {% for article in article_list %} + <p>{{ article.headline }}</p> + <p>By {{ article.reporter.full_name }}</p> <p>Published {{ article.pub_date|date:"F j, Y" }}</p> - {{ article.article }} + {% endfor %} {% endblock %} Variables are surrounded by double-curly braces. ``{{ article.headline }}`` |
