Add str to comment
This commit is contained in:
parent
c997c6b9aa
commit
fbfceecc93
1 changed files with 3 additions and 0 deletions
|
@ -134,5 +134,8 @@ class Comment(AdminUrlMixin, models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ["created_at"]
|
ordering = ["created_at"]
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return f"{self.username} - {self.content[:50]}"
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return self.article.get_absolute_url() + "#" + str(self.id)
|
return self.article.get_absolute_url() + "#" + str(self.id)
|
||||||
|
|
Reference in a new issue