Add comment revision count field
This commit is contained in:
parent
b02a30819f
commit
ff6988f29c
5 changed files with 41 additions and 17 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue