Updated forum modal to use HTML fields
This commit is contained in:
parent
cce204b1fc
commit
71eaabda58
@ -1,6 +1,8 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
from tinymce.models import HTMLField
|
||||||
|
|
||||||
|
|
||||||
class Thread(models.Model):
|
class Thread(models.Model):
|
||||||
topic = models.CharField(max_length=255)
|
topic = models.CharField(max_length=255)
|
||||||
@ -10,11 +12,12 @@ class Thread(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Post(models.Model):
|
class Post(models.Model):
|
||||||
topic = models.ForeignKey(Thread)
|
|
||||||
title = models.CharField(max_length=255)
|
|
||||||
question = models.TextField()
|
|
||||||
creator = models.ForeignKey(User)
|
creator = models.ForeignKey(User)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
resolved = models.BooleanField(default=False)
|
||||||
|
topic = models.ForeignKey(Thread)
|
||||||
|
title = models.CharField(max_length=255)
|
||||||
|
question = HTMLField()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
@ -22,7 +25,7 @@ class Post(models.Model):
|
|||||||
|
|
||||||
class Comment(models.Model):
|
class Comment(models.Model):
|
||||||
post = models.ForeignKey(Post)
|
post = models.ForeignKey(Post)
|
||||||
reply = models.TextField()
|
reply = HTMLField()
|
||||||
creator = models.ForeignKey(User)
|
creator = models.ForeignKey(User)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user