1 from http
import HTTPStatus
3 __author__
= "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
6 class DbException(Exception):
8 def __init__(self
, message
, http_code
=HTTPStatus
.NOT_FOUND
):
9 self
.http_code
= http_code
10 Exception.__init
__(self
, "database exception " + message
)
18 def db_connect(self
, config
):
21 def db_disconnect(self
):
24 def get_list(self
, table
, filter={}):
27 def get_one(self
, table
, filter={}, fail_on_empty
=True, fail_on_more
=True):
30 def create(self
, table
, indata
):
33 def del_list(self
, table
, filter={}):
36 def del_one(self
, table
, filter={}, fail_on_empty
=True):