Python 我想花一本字典来修改web.py的模板
我想花一个字典来做模板,但是没有为我打印任何东西,如果我在传递字典之前打印,就可以访问坐标Python 我想花一本字典来修改web.py的模板,python,django,dictionary,web.py,tweepy,Python,Django,Dictionary,Web.py,Tweepy,我想花一个字典来做模板,但是没有为我打印任何东西,如果我在传递字典之前打印,就可以访问坐标 tweets = tweetCol.find({"contenido" : contenido, "direccion" : direccion,"radio" : radio} ) for t in tweets: print t['CoordenadasTweet'] return render.app(form, centro,tweets) 本刊: 这个打印是我想
tweets = tweetCol.find({"contenido" : contenido, "direccion" : direccion,"radio" : radio} )
for t in tweets:
print t['CoordenadasTweet']
return render.app(form, centro,tweets)
本刊:
这个打印是我想在模板中做的
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyB4_8JwKM_0AkAM0YJouBBg0wYhWs8dHpY&sensor=false"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng($direccion)
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
$for t in tweets :
var myLatlng = new google.maps.LatLng($t['CoordenadasTweet'][0], $t['CoordenadasTweet'][1]);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"$t["ciudadUsuario"]"
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
var映射;
函数初始化(){
变量映射选项={
缩放:8,
中心:新google.maps.LatLng($direccion)
};
map=new google.maps.map(document.getElementById('map-canvas'),
地图选项);
推特中的t美元:
var myLatlng=new google.maps.LatLng($t['CoordenadasTweet'][0],$t['CoordenadasTweet'][1]);
var marker=new google.maps.marker({
职位:myLatlng,
地图:地图,
标题:$t[“ciudadUsuario”]
});
}
google.maps.event.addDomListener(窗口“加载”,初始化);