Aamir Rind
Aamir Rind

Reputation: 39659

Django AttributeError: 'Manager' object has no attribute 'select_for_update'

I have a simple model define in Django. I want to select an Object using django select_for_update method to ensure data persistence as multiple threads needs to update single row but different columns. But it is giving following error:

Obj = my_model.objects.select_for_update().filter(pk=1)

AttributeError: 'Manager' object has no attribute 'select_for_update'

Please help me in solving this issue. Thanks

Upvotes: 0

Views: 4278

Answers (1)

Arthur Neves
Arthur Neves

Reputation: 12128

check it out the documentation : https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_for_update

so if you`ll have to upgrade your django version to the development version!

Upvotes: 1

Related Questions