Add comment revision count field

This commit is contained in:
cuom1999 2023-12-05 20:01:23 -06:00
parent b02a30819f
commit ff6988f29c
5 changed files with 41 additions and 17 deletions

View file

@ -56,6 +56,7 @@ class Comment(MPTTModel):
related_name="replies",
on_delete=CASCADE,
)
revision_count = models.PositiveIntegerField(default=1)
versions = VersionRelation()
@ -118,10 +119,6 @@ class Comment(MPTTModel):
query = Comment.filter(parent=self)
return len(query)
@cached_property
def get_revisions(self):
return self.versions.count()
@cached_property
def page_title(self):
if isinstance(self.linked_object, Problem):