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 message
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 the
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"?
--~--~-~--~~~---~--
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 l
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 t
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 work
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.
--~--~-~--~~~---~-
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 django-users@googlegroups.c
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 dj
{% block {{story.title}} %}{% endblock %}
Maybe my question should be can i add a varible inside {% %} ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
10 matches
Mail list logo