沒關係,這是用瓶和Jinja2的使用Ajax一起做的正確方法。在使用谷歌購物API主要'項目'對象時,必須注意使用JSON以及它如何正確映射到其等價的python對象:
"product": {
"googleId": "9243781955569725518",
"author": {
"name": "CompUPlus.com",
"accountId": "1209120"
},
"creationTime": "2010-03-04T09:51:45.000Z",
"modificationTime": "2010-11-25T09:24:08.000Z",
"language": "en",
"country": "US",
"title": "Logitech Squeezebox Radio, black",
"description": "Logitech Squeezebox Radio brings a world of free Internet radio subscription
services and your personal digital music collection to any space in your home
over your Wi-Fi network.",
"link": "http://www.compuplus.com/Radios/LOGITECH-Squeezebox-Radio-BLK-930-1115160.html",
"gtin": "00097855063601",
"gtins": [
"00097855063601"
],
"brand": "Logitech",
"mpn": "930-000101",
"condition": "new",
"images": [
{ "link": "http://content.etilize.com/300/1014430207.jpg" }
]
"inventories": [
{
"channel": "online",
"availability": "inStock",
"currency": "usd",
"price": 183.19
}
],
}