Преглед на файлове

Truncate comments in JournalEntryTable

Jeremy Stretch преди 5 години
родител
ревизия
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