How do I run update and select statements in the same queryset instead of having to do two queries: one to select the object and one to update the object?
The equivalent in SQL would be something like:
update my_table set field_1 = 'some value' where pk_field = some_valueYou can do it in the following way:
MyModel.objects.filter(pk=some_value).update(field1='some value')If you want to go deeper into the subject, I leave you this link: https://docs.djangoproject.com/en/3.1/topics/db/queries/#topics-db-queries-update