You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
sorry but i have a big problem
I have this
mylist = ['a','b','c']
than Mydbtable.filter(column = value),update(mylist[0]=value)
why update never accept mylist[0] there is a solution?
regards
Adam Mičuda
unread,
Oct 11, 2019, 7:24:29 PM10/11/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
it is not working, because it is not valid python. Use Mydbtable.filter(column = value).update(**{mylist[0]: value}) instead. And keep in mind that value of mylist[0] (any dict key in general) must meet the some criteria to be valid dict key. See https://wiki.python.org/moin/DictionaryKeys for more information.
Regards
Adam
Dne pátek 11. října 2019 18:05:09 UTC+2 Luca Bertolotti napsal(a):