mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 20:29:15 +02:00
See #170: RSS feeds for channels
This commit is contained in:
parent
a04b0b706b
commit
9c22a72ed1
18 changed files with 923 additions and 6 deletions
|
@ -301,6 +301,20 @@ class Content(models.Model):
|
|||
|
||||
return utils.render_html(self.text, self.content_type)
|
||||
|
||||
@property
|
||||
def as_plain_text(self):
|
||||
from . import utils
|
||||
|
||||
return utils.render_plain_text(self.rendered)
|
||||
|
||||
def truncate(self, length):
|
||||
text = self.as_plain_text
|
||||
truncated = text[:length]
|
||||
if len(truncated) < len(text):
|
||||
truncated += "…"
|
||||
|
||||
return truncated
|
||||
|
||||
|
||||
@receiver(models.signals.post_save, sender=Attachment)
|
||||
def warm_attachment_thumbnails(sender, instance, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue