Re: Displaying content in different styles.

2009-04-29 Thread Malcolm Tredinnick
On Wed, 2009-04-29 at 21:11 +0300, Oleg Oltar wrote: [...] > Is there a way to check in the loop if it's a first item. And if so to > process it in a different way? Or do I have pass first article to > template separately? Inside a for-loop you have access to a the counter for the loop and there

Displaying content in different styles.

2009-04-29 Thread Oleg Oltar
Hi! I created a simple view to display articles on my homepage. Here's the code: def homepage(request): news = models.Section.objects.get(section = 'News') articles = models.Article.objects.exclude(section = news.id ).order_by("-pub_date") list_of_news = models.Article.objects.filter