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 # TODO change to http.HTTPStatus instead of int that allows .value and .name
10 self
.http_code
= http_code
11 Exception.__init
__(self
, "database exception " + message
)
19 def db_connect(self
, config
):
22 def db_disconnect(self
):
25 def get_list(self
, table
, filter={}):
28 def get_one(self
, table
, filter={}, fail_on_empty
=True, fail_on_more
=True):
31 def create(self
, table
, indata
):
34 def del_list(self
, table
, filter={}):
37 def del_one(self
, table
, filter={}, fail_on_empty
=True):