summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-05 21:06:00 -0400
committerDusty Phillips <buchuki@gmail.com>2008-10-05 21:06:00 -0400
commita00f85e1332ca973cec807693e383accd9cdc864 (patch)
tree6c99f0ccf8177a0c88f67c5689d837d85aeb633c /main/models.py
parent06963130c85f8632b898a2d98e7931951c7735a4 (diff)
port news to django 1.0 using generic views
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py
index f988996a..a2753bc3 100644
--- a/main/models.py
+++ b/main/models.py
@@ -1,6 +1,7 @@
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
+from archweb_dev.main.middleware import get_user
import re
###########################
@@ -135,7 +136,8 @@ class Donor(models.Model):
class News(models.Model):
id = models.AutoField(primary_key=True)
- author = models.ForeignKey(User, related_name='news_author')
+ author = models.ForeignKey(User, related_name='news_author',
+ default=get_user)
postdate = models.DateField(auto_now_add=True)
title = models.CharField(max_length=255)
content = models.TextField()