1👍
for k in keyword:
keyword_list.append(k.genre)
print k.genre
form=ChangeProfile(request.POST,initial={'keyword':keyword_list},)
Mind the indentation. If your request.POST
contains a value for keyword
, you’ll lose your initial values.
Source:stackexchange.com