mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 15:51:08 -05:00
Add comments app with models, views, and tests; integrate comments into existing models
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.validators import MinValueValidator, MaxValueValidator
|
||||
from history_tracking.models import HistoricalModel, VersionBranch, ChangeSet
|
||||
@@ -40,6 +40,12 @@ class Review(HistoricalModel):
|
||||
related_name='moderated_reviews'
|
||||
)
|
||||
moderated_at = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
# Comments
|
||||
comments = GenericRelation('comments.CommentThread',
|
||||
related_name='review_threads',
|
||||
related_query_name='comments_thread'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-created_at']
|
||||
|
||||
Reference in New Issue
Block a user