Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #1811 -- Fixed some inconsistencies in docs/overview.txt. Thank…

…s, quarkcool@yahoo.fr

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f0141f1c1c17bad4e1fd9bb922c92d23f97ad4b2 1 parent 8e441e9
Adrian Holovaty authored May 08, 2006

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. 15  docs/overview.txt
15  docs/overview.txt
@@ -183,7 +183,7 @@ is a simple Python function. Each view gets passed a request object --
183 183
 which contains request metadata -- and the values captured in the regex.
184 184
 
185 185
 For example, if a user requested the URL "/articles/2005/05/39323/", Django
186  
-would call the function ``myproject.news.views.article_detail(request,
  186
+would call the function ``mysite.news.views.article_detail(request,
187 187
 '2005', '05', '39323')``.
188 188
 
189 189
 Write your views
@@ -199,7 +199,7 @@ and renders the template with the retrieved data. Here's an example view for
199 199
 
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
205 205
 features but strives to stay simple enough for non-programmers to use.
@@ -219,13 +219,16 @@ might look like::
219 219
 
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
 
231 234
 Variables are surrounded by double-curly braces. ``{{ article.headline }}``

0 notes on commit f0141f1

Please sign in to comment.
Something went wrong with that request. Please try again.