view bns_website/news/models.py @ 22:6cb0d49187ae

I added a list_filter and search_fields to the model admin for the news app. That way you can sort by date and search the title and content.
author Bob Mourlam <bob.mourlam@gmail.com>
date Mon, 31 Oct 2011 21:45:03 -0500
parents 687af3cb0525
children 1357c69e887d
line wrap: on
line source
from django.db import models

# Create your models here.
class News(models.Model):
    """
    This model represents all the info we store about each news entry.

    """
    title = models.CharField(max_length=128)
    date = models.DateTimeField()
    content = models.TextField()

    # User field?



    class Meta:
        verbose_name_plural="News"
        ordering = ['-date']

    def __unicode__(self):
        return self.title