Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

hemamaps / django-import-export   python

Repository URL to install this package:

Version: 0.4.5 

/ django_compat.py

from __future__ import unicode_literals

from django.db import transaction

# transaction management for Django < 1.6


def atomic(*args, **kw):
    def noop_decorator(func):
        return func  # pass through

    return noop_decorator


def savepoint(*args, **kwargs):
    transaction.enter_transaction_management()
    transaction.managed(True)


def savepoint_rollback(*args, **kwargs):
    transaction.rollback()
    transaction.leave_transaction_management()


def savepoint_commit(*args, **kwargs):
    transaction.commit()
    transaction.leave_transaction_management()