python django

def index(request):# print(keyword.objects.all()) # for i in keyword.objects.all(): # print(i) # print(keyword.objects.filter(keyID=1)) # print(keyword.objects.coun...
def index(request):
# print(keyword.objects.all())
# for i in keyword.objects.all():
# print(i)

# print(keyword.objects.filter(keyID=1))
# print(keyword.objects.count())
indexList = []
for i in range(1,keydata.objects.count()+1):
iList = []
Name = ""
# print(i)
iList.append(i)
# 颜色Color
# print(keydata.objects.get(pk=i).Color)
iList.append(keydata.objects.get(pk=i).Color)
# 出现了多少次
# print(key.objects.filter(keyID=i).count())
iList.append(key.objects.filter(keyID=i).count())
# 出现了多少个关键词
for keyName in keyword.objects.filter(keyID=i):
# print(keyName.key)
Name += keyName.key + " "
iList.append(Name)
indexList += [iList]
print(indexList)
return render(request, 'myapp/index.html', {'indexList': indexList})
  • 发表于 2021-02-23 14:19
  • 阅读 ( 259 )

你可能感兴趣的文章

相关问题

1 条评论

请先 登录 后评论
阿九
阿九

20 篇文章

作家榜 »

  1. 阿九 20 文章
  2. q5320 14 文章
  3. 不期而遇 8 文章
  4. admin 7 文章
  5. 此心安處是吾鄉 4 文章
  6. 小白 4 文章
  7. Mr.Pang 3 文章
  8. yixinBC 3 文章