summaryrefslogtreecommitdiff
path: root/website/models.py
diff options
context:
space:
mode:
authorJayaram Pai2014-04-19 17:55:25 +0530
committerJayaram Pai2014-04-19 17:55:25 +0530
commit2fbf3ecf6cae63691380ec8cc9df2c4beff29dae (patch)
tree11212c19678c33f4546987079b05f037406ea9b1 /website/models.py
parent83063012ac3eac51983c83d3b1681595aa59eb1d (diff)
downloadspoken-tutorial-forums-2fbf3ecf6cae63691380ec8cc9df2c4beff29dae.tar.gz
spoken-tutorial-forums-2fbf3ecf6cae63691380ec8cc9df2c4beff29dae.tar.bz2
spoken-tutorial-forums-2fbf3ecf6cae63691380ec8cc9df2c4beff29dae.zip
basic email and notification added, new frontpage interface
Diffstat (limited to 'website/models.py')
-rw-r--r--website/models.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/website/models.py b/website/models.py
index 7157ee5..c280d2d 100644
--- a/website/models.py
+++ b/website/models.py
@@ -16,7 +16,7 @@ class Question(models.Model):
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
views = models.IntegerField(default=1)
- votes = models.IntegerField(default=0)
+ # votes = models.IntegerField(default=0)
def user(self):
user = User.objects.get(id=self.uid)
@@ -39,7 +39,7 @@ class Answer(models.Model):
body = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
- votes = models.IntegerField(default=0)
+ # votes = models.IntegerField(default=0)
def user(self):
user = User.objects.get(id=self.uid)
@@ -64,8 +64,13 @@ class Notification(models.Model):
uid = models.IntegerField()
pid = models.IntegerField()
qid = models.IntegerField()
- rid = models.IntegerField()
+ aid = models.IntegerField(default=0)
+ cid = models.IntegerField(default=0)
date_created = models.DateTimeField(auto_now_add=True)
+
+ def poster(self):
+ user = User.objects.get(id=self.pid)
+ return user.username
# CDEEP database created using inspectdb arg of manage.py
class TutorialDetails(models.Model):