summaryrefslogtreecommitdiff
path: root/news/models.py
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-11-03 03:45:10 -0400
committereliott <eliott@cactuswax.net>2007-11-03 03:45:10 -0400
commit39a548fd2629f3b6383990264b2e331b3aea99fb (patch)
treef68c3156dad5f7814473ceff2461679ddf11a2e8 /news/models.py
Initial import for public release...
Special Note Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!
Diffstat (limited to 'news/models.py')
-rw-r--r--news/models.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/news/models.py b/news/models.py
new file mode 100644
index 00000000..acd9667c
--- /dev/null
+++ b/news/models.py
@@ -0,0 +1,19 @@
+from django.db import models
+from django.contrib.auth.models import User
+import re
+from archlinux.utils import Stripper
+
+class News(models.Model):
+ id = models.AutoField(primary_key=True)
+ author = models.ForeignKey(User)
+ postdate = models.DateField(auto_now_add=True)
+ title = models.CharField(maxlength=255)
+ content = models.TextField()
+ class Meta:
+ db_table = 'news'
+ verbose_name_plural = 'news'
+ get_latest_by = 'postdate'
+ ordering = ['-postdate', '-id']
+
+ def get_absolute_url(self):
+ return '/news/%i/' % self.id