-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
37 lines (29 loc) · 1.23 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from django.db import models
from django.utils.translation import ugettext_lazy as _
class DDUser(models.Model):
name = models.CharField(max_length=255)
avatar = models.TextField(blank=True)
bio = models.TextField(blank=True)
class Issue(models.Model):
name = models.CharField(max_length=255)
author = models.ForeignKey(DDUser, related_name="user")
text = models.TextField()
thresshold = models.IntegerField(default=5000)
positive = models.IntegerField(default = 0)
negative = models.IntegerField(default = 0)
neutral = models.IntegerField(default = 0)
class Comment(models.Model):
issue = models.ForeignKey(Issue, related_name="comments")
category = models.TextField(blank=True)
author = models.ForeignKey(DDUser)
content = models.TextField(blank=True)
vote_up = models.IntegerField(default=0)
vote_down = models.IntegerField(default=0)
class RelatedLink(models.Model):
issue = models.ForeignKey(Issue, related_name="related_links")
author = models.ForeignKey(DDUser)
title = models.TextField(blank=True)
content = models.TextField(blank=True)
#could be URL field
vote_up = models.IntegerField(default=0)
vote_down = models.IntegerField(default=0)