Den*_*hie 1 python django django-templates django-views
我有一个大的JSON对象(来自Google Feed API)和来自上下文的URL.当上下文中的URL与供稿条目URL中的URL相同时,django应该解析!
{for aEntry in feed.entries %}
{% if aEntry.link == {{my_URL}} %}
<p>URL FOUND in feed entry</p>
{% endif %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
这不行!!
编辑:
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"}
Run Code Online (Sandbox Code Playgroud)
{% if "aEntry.link" == {{my_URL}} %}
Run Code Online (Sandbox Code Playgroud)
需要是
{% ifequal aEntry.link my_URL %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
573 次 |
| 最近记录: |