def rollback(using=None):
    if using is None:
        using = DEFAULT_DB_ALIAS
    connection = connections[using]
    connection.rollback()
This function does the rollback itself and resets the dirty flag.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/transaction.py/rollback