Moved admin media under media dir.
[archweb_dev-nj.git] / news / models.py
blob68d2865dedb73f99cbf3a222ea9d09bfb572c841
1 from django.db import models
2 from django.contrib.auth.models import User
3 import re
4 from archweb_dev.utils import Stripper
6 class News(models.Model):
7 id = models.AutoField(primary_key=True)
8 author = models.ForeignKey(User)
9 postdate = models.DateField(auto_now_add=True)
10 title = models.CharField(maxlength=255)
11 content = models.TextField()
12 class Meta:
13 db_table = 'news'
14 verbose_name_plural = 'news'
15 get_latest_by = 'postdate'
16 ordering = ['-postdate', '-id']
18 def get_absolute_url(self):
19 return '/news/%i/' % self.id