[英]Django AttributeError: 'Manager' object has no attribute 'select_for_update'
我在Django中定義了一個簡單的模型。 我想使用django select_for_update
方法選擇一個對象,以確保數據持久性,因為多個線程需要更新單行但不同的列。 但是它給出了以下錯誤:
Obj = my_model.objects.select_for_update().filter(pk=1)
AttributeError: 'Manager' object has no attribute 'select_for_update'
請幫助我解決這個問題。 謝謝
查看文檔: https : //docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_for_update
因此,如果您必須將Django版本升級到開發版本!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.