app/django/db/backends/dummy/base.py
author Pawel Solyga <Pawel.Solyga@gmail.com>
Fri, 22 Aug 2008 13:44:50 +0000
changeset 99 8c38b546a3cf
parent 54 03e267d67478
child 323 ff1a9aa48cfd
permissions -rw-r--r--
Added public view support (not using controller yet) Changed Google Account variable from user to id in views and templates (no more confusions with Melange user). Added templates_helpers for makeSimblingTemplate function. Addded new template tag readonly_field_as_table_row used in public views Fixed one typo in roles.py

"""
Dummy database backend for Django.

Django uses this if the DATABASE_ENGINE setting is empty (None or empty string).

Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""

from django.core.exceptions import ImproperlyConfigured
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations

def complain(*args, **kwargs):
    raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."

def ignore(*args, **kwargs):
    pass

class DatabaseError(Exception):
    pass

class IntegrityError(DatabaseError):
    pass

class DatabaseOperations(BaseDatabaseOperations):
    quote_name = complain

class DatabaseWrapper(object):
    features = BaseDatabaseFeatures()
    ops = DatabaseOperations()
    operators = {}
    cursor = complain
    _commit = complain
    _rollback = ignore

    def __init__(self, **kwargs):
        pass

    def close(self):
        pass