feat: add error message page; improve admin ui; add missing test files

This commit is contained in:
bkfox
2023-09-12 21:00:44 +02:00
parent a0468899b0
commit 876e4cdfa7
28 changed files with 1242 additions and 438 deletions

View File

@ -278,6 +278,16 @@ class Comment(models.Model):
date = models.DateTimeField(auto_now_add=True)
content = models.TextField(_("content"), max_length=1024)
item_template_name = "aircox/widgets/comment_item.html"
@cached_property
def parent(self):
"""Return Page as its subclass."""
return Page.objects.select_subclasses().filter(id=self.page_id).first()
def get_absolute_url(self):
return self.parent.get_absolute_url()
class Meta:
verbose_name = _("Comment")
verbose_name_plural = _("Comments")