I’m looking for a template tag something like truncatewords 
<https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#truncatewords> 
that 
will truncate a string (usually: TextFields) on a sentence boundary (double 
newline, sentence punctuation etc.). 

I’d prefer to implement this as a template tag for maximum portability. I 
would use it on several projects where I can’t alter models.py.

I realize this probably involves Regular Expressions which…wow, where to 
start? I’m a designer & not much of a programmer. 

This seems like a really common problem and surely someone has some 
traction on it elsewhere.

*(Cross-posted to StackOverflow 
<http://stackoverflow.com/questions/34405097/looking-for-a-django-template-filter-like-truncatewords-that-truncates-on-a-sent>
 if 
you want to answer there for extra karma)*

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5240474-ba89-4ca4-89d7-0dc74e9b7771%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to