annotate bns_website/news/models.py @ 21:687af3cb0525

I change the news model to have reverse chronological ordering. I removed a rogue </div> tab from the news_list.html template.
author Bob Mourlam <bob.mourlam@gmail.com>
date Mon, 31 Oct 2011 20:55:02 -0500
parents 2de51cc51d3a
children 1357c69e887d
rev   line source
bob@14 1 from django.db import models
bob@14 2
bob@14 3 # Create your models here.
bob@14 4 class News(models.Model):
bob@14 5 """
bob@14 6 This model represents all the info we store about each news entry.
bob@14 7
bob@14 8 """
bob@14 9 title = models.CharField(max_length=128)
bob@14 10 date = models.DateTimeField()
bob@14 11 content = models.TextField()
bob@14 12
bob@14 13 # User field?
bob@14 14
bob@14 15
bob@14 16
bob@14 17 class Meta:
bob@14 18 verbose_name_plural="News"
bob@21 19 ordering = ['-date']
bob@14 20
bob@14 21 def __unicode__(self):
bob@14 22 return self.title