Add comments app with models, views, and tests; integrate comments into existing models

This commit is contained in:
pacnpal
2025-02-07 21:58:02 -05:00
parent 86ae24bbac
commit 75f5b07129
18 changed files with 314 additions and 15 deletions

View File

@@ -41,6 +41,10 @@ class RideModel(HistoricalModel):
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
comments = GenericRelation('comments.CommentThread',
related_name='ride_model_threads',
related_query_name='comments_thread'
)
class Meta:
ordering = ['manufacturer', 'name']
@@ -179,6 +183,10 @@ class Ride(HistoricalModel):
updated_at = models.DateTimeField(auto_now=True)
photos = GenericRelation('media.Photo')
reviews = GenericRelation('reviews.Review')
comments = GenericRelation('comments.CommentThread',
related_name='ride_threads',
related_query_name='comments_thread'
)
class Meta:
ordering = ['name']