I'm looking for a template tag something like truncatewords that will truncate a string (usually: TextField
s) 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 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+unsubscribe@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.
No comments:
Post a Comment