Friday, October 11, 2019

Re: filter.update

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):
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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/234f7473-96cd-41c2-94c3-6a79339efc1d%40googlegroups.com.

No comments:

Post a Comment