Ticket #3450: IntegrityError.diff

File IntegrityError.diff, 3.8 KB (added by enlight, 17 years ago)
  • django/db/__init__.py

     
    22from django.core import signals
    33from django.dispatch import dispatcher
    44
    5 __all__ = ('backend', 'connection', 'DatabaseError')
     5__all__ = ('backend', 'connection', 'DatabaseError', 'IntegrityError')
    66
    77if not settings.DATABASE_ENGINE:
    88    settings.DATABASE_ENGINE = 'dummy'
     
    2929
    3030connection = backend.DatabaseWrapper(**settings.DATABASE_OPTIONS)
    3131DatabaseError = backend.DatabaseError
     32IntegrityError = backend.IntegrityError
    3233
    3334# Register an event that closes the database connection
    3435# when a Django request is finished.
  • django/db/backends/ado_mssql/base.py

     
    1717    mx = None
    1818
    1919DatabaseError = Database.DatabaseError
     20IntegrityError = Database.IntegrityError
    2021
    2122# We need to use a special Cursor class because adodbapi expects question-mark
    2223# param style, but Django expects "%s". This cursor converts question marks to
  • django/db/backends/postgresql/base.py

     
    1212    raise ImproperlyConfigured, "Error loading psycopg module: %s" % e
    1313
    1414DatabaseError = Database.DatabaseError
     15IntegrityError = Database.IntegrityError
    1516
    1617try:
    1718    # Only exists in Python 2.4+
  • django/db/backends/sqlite3/base.py

     
    1818    raise ImproperlyConfigured, "Error loading %s module: %s" % (module, e)
    1919
    2020DatabaseError = Database.DatabaseError
     21IntegrityError = Database.IntegrityError
    2122
    2223Database.register_converter("bool", lambda s: str(s) == '1')
    2324Database.register_converter("time", util.typecast_time)
  • django/db/backends/mysql/base.py

     
    1616import re
    1717
    1818DatabaseError = Database.DatabaseError
     19IntegrityError = Database.IntegrityError
    1920
    2021django_conversions = conversions.copy()
    2122django_conversions.update({
  • django/db/backends/oracle/base.py

     
    1212    raise ImproperlyConfigured, "Error loading cx_Oracle module: %s" % e
    1313
    1414DatabaseError = Database.Error
     15IntegrityError = Database.IntegrityError
    1516
    1617try:
    1718    # Only exists in Python 2.4+
  • django/db/backends/postgresql_psycopg2/base.py

     
    1212    raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e
    1313
    1414DatabaseError = Database.DatabaseError
     15IntegrityError = Database.IntegrityError
    1516
    1617try:
    1718    # Only exists in Python 2.4+
  • django/db/backends/dummy/base.py

     
    1515class DatabaseError(Exception):
    1616    pass
    1717
     18class IntegrityError(DatabaseError):
     19    pass
     20
    1821class DatabaseWrapper:
    1922    cursor = complain
    2023    _commit = complain
Back to Top