Carriage return.
[archweb_dev-nj.git] / news / models.py
blobb8709b4893b70b7d2b0919a06e4dc66d0170d95c
1 from django.db import models
2 from django.contrib.auth.models import User
3 import re
5 class News(models.Model):
6 id = models.AutoField(primary_key=True)
7 author = models.ForeignKey(User)
8 postdate = models.DateField(auto_now_add=True)
9 title = models.CharField(maxlength=255)
10 content = models.TextField()
11 class Meta:
12 db_table = 'news'
13 verbose_name_plural = 'news'
14 get_latest_by = 'postdate'
15 ordering = ['-postdate', '-id']
17 def get_absolute_url(self):
18 return '/news/%i/' % self.id
20 # vim: set ts=4 sw=4 et: