- text = fragment.to_string()
- short_text = ''
- if (len(MarkupString(text)) > 240):
- short_text = unicode(MarkupString(text)[:160])
- new_fragment, created = Fragment.objects.get_or_create(anchor=fragment.id, book=book,
- defaults={'text': text, 'short_text': short_text})
-