~grupoesoc/cubicerp-addons/7.0

« back to all changes in this revision

Viewing changes to report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/db/backends/dummy/base.py

  • Committer: Cubic ERP
  • Date: 2014-01-07 15:38:09 UTC
  • Revision ID: info@cubicerp.com-20140107153809-4jmif3zoi8rcveve
[ADD] cubicReport

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 *
 
12
from django.db.backends.creation import BaseDatabaseCreation
 
13
 
 
14
def complain(*args, **kwargs):
 
15
    raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
 
16
 
 
17
def ignore(*args, **kwargs):
 
18
    pass
 
19
 
 
20
class DatabaseError(Exception):
 
21
    pass
 
22
 
 
23
class IntegrityError(DatabaseError):
 
24
    pass
 
25
 
 
26
class DatabaseOperations(BaseDatabaseOperations):
 
27
    quote_name = complain
 
28
 
 
29
class DatabaseClient(BaseDatabaseClient):
 
30
    runshell = complain
 
31
    
 
32
class DatabaseIntrospection(BaseDatabaseIntrospection):
 
33
    get_table_list = complain
 
34
    get_table_description = complain
 
35
    get_relations = complain
 
36
    get_indexes = complain
 
37
    
 
38
class DatabaseWrapper(object):    
 
39
    operators = {}
 
40
    cursor = complain
 
41
    _commit = complain
 
42
    _rollback = ignore
 
43
 
 
44
    def __init__(self, *args, **kwargs):
 
45
        super(DatabaseWrapper, self).__init__(*args, **kwargs)
 
46
 
 
47
        self.features = BaseDatabaseFeatures()
 
48
        self.ops = DatabaseOperations()
 
49
        self.client = DatabaseClient()
 
50
        self.creation = BaseDatabaseCreation(self)
 
51
        self.introspection = DatabaseIntrospection(self)
 
52
        self.validation = BaseDatabaseValidation()
 
53
 
 
54
    def close(self):
 
55
        pass