एक database transaction कई operations को समूहित करता है ताकि वे या तो सभी सफल हों या सभी एक साथ विफल हों (atomicity) — partial, inconsistent updates को रोकते हुए। Django operations को एक transaction में wrap करने के लिए transaction.atomic प्रदान करता है, multi-step operations के लिए data integrity सुनिश्चित करते हुए।
जिस समस्या को transactions हल करते हैं
():
from_account.balance -= amount
from_account.save()
to_account.balance += amount
to_account.save()
