You could probably reuse Django's `truncatechars` filter.