stringformat to get first 3 characters?

2009-06-11 Thread Frank Peterson
I need to use the stringformat filter on a variable in a template but I just want it to grab the first 3 characters of the variable. {{ object.caption|lower|truncatewords:"1"|stringformat:"3s" }} Doesnt seem to work. --~--~-~--~~~---~--~~ You received this

IFEQUAL takes two arguments error on Django 0.91

2009-06-10 Thread Frank Peterson
I'm on Django 0.91 (unfortunately we are stuck with that and cannot upgrade). We have a variable - object.caption and lets say that it equals "Bling: whatever" (without the quotes) I am doing a hack in the templates (dont have access to anything else, and need to output "IT WORKED!" (without

Is there a way to use the Cut Filter to only do the first instance?

2008-10-31 Thread Frank Peterson
I am using the following {{ section.get_absolute_url|cut:"/news/" }} on a string that is /news/new-york-jets/news/ I need to remove the first /news but the CUT filter removes all instances of it, is there a way for me to remove on the first "/news"?

Parsing through feed to get to enclosure data?

2008-10-16 Thread Frank Peterson
I have a RSS feed and I need to be able to get to the enclosure data out of it. Our code loads libRSS, here is what I have so far and its not working {% for itm in rss.items %} {{itm.description}} FLV {% endfor %} Here is what my feed

ifequal doesn't like spaces?

2008-10-15 Thread Frank Peterson
I have something like the following {% ifequal flatpage.title "Special Reports" %} http://example.com/icon_specialreports.png; /> {% endifequal %} I get the error 'ifequal' takes two arguments so it doesn't like the fact that "Special Reports" has a space in it. Is there a way around

Re: Is there a TRIM feature for templates in Django 0.91

2007-09-19 Thread Frank Peterson
TRIM would delete any whitespace from the string (tabs, newlines, spaces, ...). SPACELESS comes close as it will convert all the whitespace into just 1 space. I'm stuck on 0.91 at work and I dont think they plan on upgrading anytime soon (its beyond my control) I'm not sure SPACELESS doesnt

Is there a TRIM feature for templates in Django 0.91

2007-09-18 Thread Frank Peterson
I looked over the docs http://www.djangoproject.com/documentation/0_91/templates/ but the closest thing was SPACELESS I tried to use it like this: {% block data %}{% spaceless %}{{ story.tease }}{% endspaceless %}{% endblock %} But it didnt work.

Re: How do I Sort Years in Template

2007-05-23 Thread Frank Peterson
thanks, I had to use dictsortreversed and that puts them in newest year first :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

How do I Sort Years in Template

2007-05-01 Thread Frank Peterson
Story archive {% for date in date_list %} {{ date.year }} {% endfor %} Not sure how to do this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to