[Answered ]-Django: Database column not updating from variable, taking it as hardcoded name

1👍

You need to convert the parameters as dictionary and pass it through function by unpacking them, like this:

ItemAmadeus.objects \
            .filter(
                Q(id=item_id)
            ) \
            .update(
                **{field:value}
            )

This article on geeksforgeeks has some examples of unpacking.

👤ruddra

Leave a comment