Anonymous user
Boston Python Workshop/Saturday/Web app project: Difference between revisions
Boston Python Workshop/Saturday/Web app project (view source)
Revision as of 12:59, 5 March 2011
, 13 years ago→Adding more detail
imported>Paulproteus |
imported>Paulproteus |
||
Line 581:
We pass in a variable called '''poll''' that points to an instance of the Poll class. So you can pull out more information by writing this into the "polls/detail.html" template:
<pre>
</pre>
The template system uses dot-lookup syntax to access variable attributes. Django's template language is a bit sloppy: in pure Python, the '''.''' (dot) only lets you get attributes from objects. In this example, we are just doing attribute lookup, but in general if you're not sure how to get data out of an object in Django, try '''dot'''.
|