Ticket #3450: IntegrityError.diff
File IntegrityError.diff, 3.8 KB (added by , 18 years ago) |
---|
-
django/db/__init__.py
2 2 from django.core import signals 3 3 from django.dispatch import dispatcher 4 4 5 __all__ = ('backend', 'connection', 'DatabaseError' )5 __all__ = ('backend', 'connection', 'DatabaseError', 'IntegrityError') 6 6 7 7 if not settings.DATABASE_ENGINE: 8 8 settings.DATABASE_ENGINE = 'dummy' … … 29 29 30 30 connection = backend.DatabaseWrapper(**settings.DATABASE_OPTIONS) 31 31 DatabaseError = backend.DatabaseError 32 IntegrityError = backend.IntegrityError 32 33 33 34 # Register an event that closes the database connection 34 35 # when a Django request is finished. -
django/db/backends/ado_mssql/base.py
17 17 mx = None 18 18 19 19 DatabaseError = Database.DatabaseError 20 IntegrityError = Database.IntegrityError 20 21 21 22 # We need to use a special Cursor class because adodbapi expects question-mark 22 23 # param style, but Django expects "%s". This cursor converts question marks to -
django/db/backends/postgresql/base.py
12 12 raise ImproperlyConfigured, "Error loading psycopg module: %s" % e 13 13 14 14 DatabaseError = Database.DatabaseError 15 IntegrityError = Database.IntegrityError 15 16 16 17 try: 17 18 # Only exists in Python 2.4+ -
django/db/backends/sqlite3/base.py
18 18 raise ImproperlyConfigured, "Error loading %s module: %s" % (module, e) 19 19 20 20 DatabaseError = Database.DatabaseError 21 IntegrityError = Database.IntegrityError 21 22 22 23 Database.register_converter("bool", lambda s: str(s) == '1') 23 24 Database.register_converter("time", util.typecast_time) -
django/db/backends/mysql/base.py
16 16 import re 17 17 18 18 DatabaseError = Database.DatabaseError 19 IntegrityError = Database.IntegrityError 19 20 20 21 django_conversions = conversions.copy() 21 22 django_conversions.update({ -
django/db/backends/oracle/base.py
12 12 raise ImproperlyConfigured, "Error loading cx_Oracle module: %s" % e 13 13 14 14 DatabaseError = Database.Error 15 IntegrityError = Database.IntegrityError 15 16 16 17 try: 17 18 # Only exists in Python 2.4+ -
django/db/backends/postgresql_psycopg2/base.py
12 12 raise ImproperlyConfigured, "Error loading psycopg2 module: %s" % e 13 13 14 14 DatabaseError = Database.DatabaseError 15 IntegrityError = Database.IntegrityError 15 16 16 17 try: 17 18 # Only exists in Python 2.4+ -
django/db/backends/dummy/base.py
15 15 class DatabaseError(Exception): 16 16 pass 17 17 18 class IntegrityError(DatabaseError): 19 pass 20 18 21 class DatabaseWrapper: 19 22 cursor = complain 20 23 _commit = complain