Golden Codes - armanexplorer planet

Practical code snippets for Django, Python, Bash, Git and All!

View on GitHub

Returns a queryset that will lock rows until the end of the transaction, generating a SELECT ... FOR UPDATE SQL statement on supported databases.

Django’s select_for_update will release the lock when the outermost transaction it is inside gets committed

Locks in PostgreSQL are granted to a database connection

Docs

Exmaple