Always use the magic List

Yes i need to record this historical moment that I have solved the data transfer method problem with Python~

def home(request):

line ='[{"dut_id":"100","nickname":"Frontier","sku_id":"600WW"},{"dut_id":"101","nickname":"FRT_Gateway","sku_id":"600WW"},{"dut_id":"102","nickname":"ANT","sku_id":"600WW"},{"dut_id":"200","nickname":"Equator","sku_id":"600WW"},{"dut_id":"300","nickname":"Core2","sku_id":"600WW"},{"dut_id":"400","nickname":"Danube","sku_id":"600WW"},{"dut_id":"500","nickname":"PDA","sku_id":"600CN"}]'

    obj = json.loads(line)

nickname =list()

i =0

    while i

nickname.append(obj[i]['nickname'])

i = i+1

    return render(request, 'home.html', {'nickname': nickname})

After several investigation I found "select"/"option" is still a better choice than menu

And sadly found it is hard to change option appearance

And I still need to do some local storage as there are some matching relationships of those data

So tomorrow's task is to understand "Get" "Post" method and how to get ride of the "unique" value issue and avoid rewrite each object each time opening Home

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容