List Info

Thread: To Truncate a Word to # of chars




To Truncate a Word to # of chars
user name
2006-02-26 21:16:27
emm.. But wait a sec! How do I call a python function from
django
template. I don't think it is allowed, meaning that I'd
still have to
write a filter using textwrap:

>>> wrap('siasookhteh', 5)
['siaso', 'okhte', 'h']

Sia -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

To Truncate a Word to # of chars
user name
2006-02-27 07:06:44
Reading the source code of the "slice" filter in
Django it looks to me
like it should work on strings as well as lists. If you only
need to
truncate and discard the extra characters, that would be the
way to go.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )