i want to convert my list into dict to have my id so i try this in my views
def img2(request):
posts = Post.objects.all()
i=[]
for p in posts
print(p.id)
i.append(p.id)
#post={'id':str(p.id)}
#print(i)
'''def Convert(lst):
res_dct = {str(lst[i]): lst[i] for i in range(0, len(lst), 1)}
return res_dct
# Driver code
…
Top comments (0)