我有一个很大的JSON对象(来自Google Feed API)和一个来自上下文的URL。当上下文的URL与提要条目URL相同时,django应解析!Django如果标签没有评估相等性
{for aEntry in feed.entries %}
{% if aEntry.link == {{my_URL}} %}
<p>URL FOUND in feed entry</p>
{% endif %}
{% endfor %}
这不工作!
编辑:
feed: {
"feedUrl": "http://.blogspot.in//feeds/posts/default",
"title": "",
"link": "http://.blogspot.com/",
"author": "",
"description": "",
"type": "atom10",
"entries": [{
"title": "Shades",
"link": "http://.blogspot.com/myurl.html",
"author": "",
"publishedDate": "Sun, 29 Jul 2012 04:07:00 -0700",
"contentSnippet": "abstract art!",
"content": " HTML CONTENT HERE",
"categories": ["abstract"]
}
context = { "feed" : feed, "my_url" : "http://.blogspot.com/myurl.html"}
“aEntry.link” 是一个字符串 – anhtran
@anhtran是啊,所以做'{{my_URL}}' –
@anhtran oops。它在这个问题上的错误..纠正! –