Explorar o código

Truncate comments in JournalEntryTable

Jeremy Stretch %!s(int64=5) %!d(string=hai) anos
pai
achega
fe4bf62793
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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