>
> description = content[:max_char_count]
>
> Isn't something like this viable?


I don't see how cutting off mid-word, or even mid-sentence could be an
improvement. But maybe capturing every sentence within a character limit
with something like:

description = re.sub(r"[!?.].*$", '', content[:max_char_count])

That's probably not quite right, but the idea is to cut out everything
after the last punctuation mark.

On Mon, May 16, 2016 at 2:36 PM, Efraim AUGUSTO GONCALVES <
[email protected]> wrote:

> Yes. This may be the best solution.
>
>
> Em segunda-feira, 16 de maio de 2016 10:28:58 UTC-4, Eduardo Rivas
> escreveu:
>>
>> Another solution: let the developer point to a callable via settings.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to