فهرست منبع

Truncate comments in JournalEntryTable

Jeremy Stretch 4 سال پیش
والد
کامیت
fe4bf62793
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      netbox/extras/tables.py

+ 3 - 0
netbox/extras/tables.py

@@ -134,6 +134,9 @@ class JournalEntryTable(ObjectJournalTable):
         orderable=False,
         verbose_name='Object'
     )
+    comments = tables.TemplateColumn(
+        template_code='{% load helpers %}{{ value|render_markdown|truncatewords_html:50 }}'
+    )
 
     class Meta(BaseTable.Meta):
         model = JournalEntry