equal
deleted
inserted
replaced
|
1 """ |
|
2 Dummy database backend for Django. |
|
3 |
|
4 Django uses this if the DATABASE_ENGINE setting is empty (None or empty string). |
|
5 |
|
6 Each of these API functions, except connection.close(), raises |
|
7 ImproperlyConfigured. |
|
8 """ |
|
9 |
|
10 from django.core.exceptions import ImproperlyConfigured |
|
11 from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations |
|
12 |
|
13 def complain(*args, **kwargs): |
|
14 raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet." |
|
15 |
|
16 def ignore(*args, **kwargs): |
|
17 pass |
|
18 |
|
19 class DatabaseError(Exception): |
|
20 pass |
|
21 |
|
22 class IntegrityError(DatabaseError): |
|
23 pass |
|
24 |
|
25 class DatabaseOperations(BaseDatabaseOperations): |
|
26 quote_name = complain |
|
27 |
|
28 class DatabaseWrapper(object): |
|
29 features = BaseDatabaseFeatures() |
|
30 ops = DatabaseOperations() |
|
31 operators = {} |
|
32 cursor = complain |
|
33 _commit = complain |
|
34 _rollback = ignore |
|
35 |
|
36 def __init__(self, **kwargs): |
|
37 pass |
|
38 |
|
39 def close(self): |
|
40 pass |