def truncateletters(value, arg):
 from django_extensions.utils.text import truncate_letters
 try:
  length = int(arg)
 except ValueError:
  return value
 return truncate_letters(value, length)

def truncateletters ( value , arg ) : from django_extensions . utils . text import truncate_letters try : length = int ( arg ) except ValueError : return value return truncate_letters ( value , length )
truncates a string after a certain number of letters argument: number of letters to truncate after .