Changes between Version 7 and Version 8 of DjangoSpecifications/Core/SingleInstance
- Timestamp:
- Mar 24, 2008, 6:09:44 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoSpecifications/Core/SingleInstance
v7 v8 57 57 return u"%s (%s)" % (self.title, self.type_of_article.name) 58 58 59 {% for article in Article.objects. all%}60 {{ article}}59 {% for article in Article.objects.filter(type=1) %} 60 {{ article.type }} 61 61 {% endfor %} 62 62 }}} 63 64 In the above example, type is only queried for once, because each iteration it knows that it's already in memory via the instance caching. This is a '''very''' common use case for many developers. 63 65 64 66 If you have a great number of articles and a smaller number of articletypes the performance/memory hit is staggering because: