Commit 910f5ea21df68339c0545b3211772ad5bae9d561

Authored by cesar
1 parent 10a00f0d

add render method

Showing 1 changed file with 0 additions and 6 deletions
@@ -14,12 +14,6 @@ class Comment(CommentAbstractModel): @@ -14,12 +14,6 @@ class Comment(CommentAbstractModel):
14 # Sofisis add this field for support images as comment 14 # Sofisis add this field for support images as comment
15 image: FieldFile = models.FileField(_('Image'), upload_to='comments/%Y/%m/', null=True, blank=True) 15 image: FieldFile = models.FileField(_('Image'), upload_to='comments/%Y/%m/', null=True, blank=True)
16 16
17 - def render_comment(self) -> str:  
18 - """ Render comment in html, include image if exists """  
19 - if self.image:  
20 - return format_html(self.comment + ' <img src="{url}"/>', url=self.image.url)  
21 - return self.comment  
22 -  
23 class Meta(CommentAbstractModel.Meta): 17 class Meta(CommentAbstractModel.Meta):
24 db_table = "django_comments" 18 db_table = "django_comments"
25 19
Please register or login to post a comment