OK, I tracked down truncatewords, and I'm thinking of something like
this:

def spanned_string(value):
        """ adds span around first half of string """
        words = s.split()
        halfwords = len(words)/2
        firsthalf = words[halfwords:]
        lasthalf = words[:halfwords]
        return <span>+ ' '.join(firsthalf) + </span>+ ' '.join(lasthalf)

On Jun 14, 12:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> What I want to do is take the number of words, divide by 2 (and round
> down a whole number), then apply a span to the first half.
>
> I tried to find truncatewords, as I figured that would be a good
> starting point (at least seeing how to count words), but I can't seem
> to track it down.
>
> Any help appreciated. Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to