9 lines
149 B
Python
9 lines
149 B
Python
|
from django import template
|
||
|
|
||
|
register = template.Library()
|
||
|
|
||
|
|
||
|
@register.filter
|
||
|
def truncate_lines(text):
|
||
|
return '\n'.join(text.split('\n')[:300])
|